调用没有匹配函数 &没有命名的成员
No matching function for call to & No member named
我遇到了两个错误。
关于" output.Add(r1.woltage((("的第一个错误;line.T给出"没有命名成员'add'in'std :: __ 1 ::数组"
关于调用函数的第二个错误。
这是我的标题;
static array<double,1> diodeClipper (array<double,1> input, double Fs){
// 1 ohm is the Ri voltage source resistor
double Ri = 1.0;
// Internal circuit parameters
VoltageSource Vin (0.0, Ri); // initialize voltage at 0V
Resistor R1 (80.0);
Capacitor C1 (3.5e-5, Fs); // Capacitor & Inductor need sampling rate (Fs) in constructor
// create WDF circuit
Serie RC (&R1, &C1);
Serie root (&Vin, &RC);
// accurate simulation of GZ34 valve diode.
double Is = 125.56; // reverse saturation current
double Vt = 0.036; // thermal voltage
// initial value for the voltage over the diode (n-1 memory)
double Vdiode = 0.0;
// for simulation
double b, r, Rdiode;
array<double,1> output;
// the simulation loop
int n=0; int max=input.size();
for (; n<max; ++n)
{
Vin.Vs = input[n]; // read the input signal for the voltage source
b = root.reflected (); // get the waves up to the root
// ** VALVE RESISTOR **
Rdiode = Is * exp(-Vt * Vdiode); // the nonlinear resistance of the diode
r = (Rdiode - root.R) // update scattering coefficient (KCL)
/ (Rdiode + root.R);
root.incident (r * b); // evaluate the wave leaving the diode (root element)
// ** UPDATE **
Vdiode = root.voltage (); // update the diode voltage for next time sample
output.add (R1.voltage()); // the output is the voltage over the resistor R1
}
return output;}
和我的main.cpp
*out1 = diodeClipper(*in1, Fs); //Where i get "No matching..." error
*out2 = diodeClipper(*in2, Fs); //Where i get "No matching..." error
"没有成员名为'add'in'std :: __ 1 :: array':std::array
不支持add
函数。标准C 容器的正确推送功能是push_back
,即使那样,std::array
也不支持它,因为它的大小在编译时固定。
呼叫没有匹配函数:diodeClipper
将std::array
作为参数,但您将其传递给双重(删除C风格数组(。std::array
是模板类,与C风格数组完全不同。
相关文章:
- 对RValue对象调用的LValue ref限定成员函数
- 为什么使用 "this" 指针调用派生成员函数?
- 将公共但非静态的成员函数与ALGLIB集成
- 使用指向成员的指针将成员函数作为参数传递
- 将重载的成员函数传递给函数模板
- 我不小心调用了一个没有自己类对象的成员函数.但这是怎么回事呢
- 如何在C++中使用非静态成员函数作为回调函数
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 关联容器的下界复杂性:成员函数与非成员函数
- 在 C++ 中用派生类型重写成员函数
- 链表的泛型函数remove()与成员函数remove)
- 如何将lambda作为模板类的成员函数参数
- constexpr构造函数需要常量成员函数时出现问题
- 将自由函数绑定为类成员函数
- 区分非成员函数和头文件中的成员函数
- 如何从子成员函数修改父公共成员变量
- 保留对其他类的成员函数的引用
- 在运算符重载定义中使用成员函数(const错误)
- 内联如何影响模块接口中的成员函数
- 将成员函数指针作为参数传递给模板方法