📄 mvector.h
字号:
// method: sub // template<class TAScalar, class TAIntegral> boolean sub(const MVector<TAScalar, TAIntegral>& vector) { return apply(*this, vector, &TScalar::sub); } // method: sub // template<class TAScalar, class TAIntegral> boolean sub(const MVector& v1, const MVector<TAScalar, TAIntegral>& v2) { return apply(v1, v2, &TScalar::sub); } // method: sub // boolean sub(TIntegral value) { return apply(*this, value, &TScalar::sub); } // method: sub // boolean sub(const MVector& vector, TIntegral value) { return apply(vector, value, &TScalar::sub); } // method: mult // template<class TAScalar, class TAIntegral> boolean mult(const MVector<TAScalar, TAIntegral>& vector) { return apply(*this, vector, &TScalar::mult); } // method: mult // template<class TAScalar, class TAIntegral> boolean mult(const MVector& v1, const MVector<TAScalar, TAIntegral>& v2) { return apply(v1, v2, &TScalar::mult); } // method: mult // boolean mult(TIntegral value) { return apply(*this, value, &TScalar::mult); } // method: mult // boolean mult(const MVector& vector, TIntegral value) { return apply(vector, value, &TScalar::mult); } // method: div // template<class TAScalar, class TAIntegral> boolean div(const MVector<TAScalar, TAIntegral>& vector) { return apply(*this, vector, &TScalar::div); } // method: div // template<class TAScalar, class TAIntegral> boolean div(const MVector& v1, const MVector<TAScalar, TAIntegral>& v2) { return apply(v1, v2, &TScalar::div); } // method: div // boolean div(TIntegral value) { return apply(*this, value, &TScalar::div); } // method: div // boolean div(const MVector& vector, TIntegral value) { return apply(vector, value, &TScalar::div); } // method: mod // boolean mod(const MVector& vector) { return apply(*this, vector, &TScalar::mod); } // method: mod // boolean mod(const MVector& v1, const MVector& v2) { return apply(v1, v2, &TScalar::mod); } // method: mod // boolean mod(TIntegral value) { return apply(*this, value, &TScalar::mod); } // method: mod // boolean mod(const MVector& vector, TIntegral value) { return apply(vector, value, &TScalar::mod); } //--------------------------------------------------------------------------- // // class-specific public methods: // other mathematical methods // //-------------------------------------------------------------------------- // common mathematical methods // boolean pow(double y) { return MVectorMethods::pow<TScalar, TIntegral>(*this, *this, y); } boolean pow(const MVector& x, double y) { return MVectorMethods::pow<TScalar, TIntegral>(*this, x, y); } // method: exp // boolean exp() { return apply(*this, &TScalar::exp); } // method: exp // boolean exp(const MVector& vector) { return apply(vector, &TScalar::exp); } // method: exp2 // boolean exp2() { return apply(*this, &TScalar::exp2); } // method: exp2 // boolean exp2(const MVector& vector) { return apply(vector, &TScalar::exp2); } // method: exp10 // boolean exp10() { return apply(*this, &TScalar::exp10); } // method: exp10 // boolean exp10(const MVector& vector) { return apply(vector, &TScalar::exp10); } // method: factorial // boolean factorial() { return apply(*this, &TScalar::factorial); } // method: factorial // boolean factorial(const MVector& vector) { return apply(vector, &TScalar::factorial); } // method: log // boolean log() { return apply(*this, &TScalar::log); } // method: log // boolean log(const MVector& vector) { return apply(vector, &TScalar::log); } // method: log1p // boolean log1p() { return apply(*this, &TScalar::log1p); } // method: log1p // boolean log1p(const MVector& vector) { return apply(vector, &TScalar::log1p); } // method: log2 // boolean log2() { return apply(*this, &TScalar::log2); } // method: log2 // boolean log2(const MVector& vector) { return apply(vector, &TScalar::log2); } // method: log10 // boolean log10() { return apply(*this, &TScalar::log10); } // method: log10 // boolean log10(const MVector& vector) { return apply(vector, &TScalar::log10); } // sorting and indexing methods // boolean sort(Integral::ORDER order = Integral::DEF_ORDER) { return MVectorMethods::sort<TScalar, TIntegral>(*this, *this, order); } boolean sort(const MVector& vector, Integral::ORDER order = Integral::DEF_ORDER) { return MVectorMethods::sort<TScalar, TIntegral>(*this, vector, order); } boolean index(MVector<Long, long>& sort_index, Integral::ORDER order = Integral::DEF_ORDER) { return MVectorMethods::index<TScalar, TIntegral>(*this, order, sort_index); } boolean randperm(long size) { return MVectorMethods::randperm(*this, size); } // method: abs // boolean abs() { return apply(*this, &TScalar::abs); } // method: abs // boolean abs(const MVector& vector) { return apply(vector, &TScalar::abs); } // mathematical limits, ceiling, floor and rounding methods // TIntegral max() const { static long pos; return MVectorMethods::max<TScalar, TIntegral>(*this, pos); } TIntegral max(long& position) const { return MVectorMethods::max<TScalar, TIntegral>(*this, position); } TIntegral min() const { static long pos; return MVectorMethods::min<TScalar, TIntegral>(*this, pos); } TIntegral min(long& position) const { return MVectorMethods::min<TScalar, TIntegral>(*this, position); } double minMag() const { static long pos; return MVectorMethods::minMag<TScalar, TIntegral>(*this, pos); } double minMag(long& position) const { return MVectorMethods::minMag<TScalar, TIntegral>(*this, position); } double maxMag() const { static long pos; return MVectorMethods::maxMag<TScalar, TIntegral>(*this, pos); } double maxMag(long& position) const { return MVectorMethods::maxMag<TScalar, TIntegral>(*this, position); } // method: neg // boolean neg() { return apply(*this, &TScalar::neg); } // method: neg // boolean neg(const MVector& vector) { return apply(vector, &TScalar::neg); } // method: round // boolean round() { return apply(*this, &TScalar::round); } // method: round // boolean round(const MVector& vector) { return apply(vector, &TScalar::round); } // method: ceil // boolean ceil() { return apply(*this, &TScalar::ceil); } // method: ceil // boolean ceil(const MVector& vector) { return apply(vector, &TScalar::ceil); } // method: rceil // boolean rceil() { return apply(*this, &TScalar::rceil); } // method: rceil // boolean rceil(const MVector& vector) { return apply(vector, &TScalar::rceil); } // method: floor // boolean floor() { return apply(*this, &TScalar::floor); } // method: floor // boolean floor(const MVector& vector) { return apply(vector, &TScalar::floor); } // method: rfloor // boolean rfloor() { return apply(*this, &TScalar::rfloor); } // method: rfloor // boolean rfloor(const MVector& vector) { return apply(vector, &TScalar::rfloor); } // method: fraction // boolean fraction() { return apply(*this, &TScalar::fraction); } // method: fraction // boolean fraction(const MVector& vector) { return apply(vector, &TScalar::fraction); } // method: sign // boolean sign() { return apply(*this, &TScalar::sign); } // method: sign // boolean sign(const MVector& vector) { return apply(vector, &TScalar::sign); } // method: sin // boolean sin() { return apply(*this, &TScalar::sin); } // method: sin // boolean sin(const MVector& vector) { return apply(vector, &TScalar::sin); } // method: sinh // boolean sinh() { return apply(*this, &TScalar::sinh); } // method: sinh // boolean sinh(const MVector& vector) { return apply(vector, &TScalar::sinh); } // method: cos // boolean cos() { return apply(*this, &TScalar::cos); } // method: cos // boolean cos(const MVector& vector) { return apply(vector, &TScalar::cos); } // method: cosh // boolean cosh() { return apply(*this, &TScalar::cosh); } // method: cosh // boolean cosh(const MVector& vector) { return apply(vector, &TScalar::cosh); } // method: tan // boolean tan() { return apply(*this, &TScalar::tan); } // method: tan // boolean tan(const MVector& vector) { return apply(vector, &TScalar::tan); } // method: tanh // boolean tanh() { return apply(*this, &TScalar::tanh); } // method: tanh // boolean tanh(const MVector& vector) { return apply(vector, &TScalar::tanh); } // method: asin // boolean asin() { return apply(*this, &TScalar::asin); } // method: asin // boolean asin(const MVector& vector) { return apply(vector, &TScalar::asin); } // method: asinh // boolean asinh() { return apply(*this, &TScalar::asinh); } // method: asinh // boolean asinh(const MVector& vector) { return apply(vector, &TScalar::asinh); } // method: acos // boolean acos() { return apply(*this, &TScalar::acos); } // method: acos // boolean acos(const MVector& vector) { return apply(vector, &TScalar::acos); } // method: acosh // boolean acosh() { return apply(*this, &TScalar::acosh); } // method: acosh // boolean acosh(const MVector& vector) { return apply(vector, &TScalar::acosh); } // method: atan // boolean atan() { return apply(*this, &TScalar::atan); } // method: atan // boolean atan(const MVector& vector) { return apply(vector, &TScalar::atan); } // method: atanh // boolean atanh() { return apply(*this, &TScalar::atanh); } // method: atanh // boolean atanh(const MVector& vector) { return apply(vector, &TScalar::atanh); } // ramp function generation methods // boolean ramp(TIntegral offset = DEF_OFFSET, TIntegral incr = DEF_INCR) { return MVectorMethods::ramp<TScalar,TIntegral>(*this, offset, incr); } // method: ramp // boolean ramp(TIntegral offset, TIntegral incr, TIntegral end) { return MVectorMethods::ramp<TScalar,TIntegral>(*this, offset, incr, end); } // method: sqrt // boolean sqrt() { return apply(*this, &TScalar::sqrt); } // method: sqrt // boolean sqrt(const MVector<TScalar,TIntegral>& vec) { return apply(vec, &TScalar::sqrt); } // method: square // boolean square() { return apply(*this, &TScalar::square); } // method: square // boolean square(const MVector<TScalar, TIntegral>& x) { return apply(x, &TScalar::square); } // inverse methods // boolean inverse() { return apply(*this, &TScalar::inverse); } boolean inverse(const MVector<TScalar, TIntegral>& x) { return apply(x, &TScalar::inverse); } // vector to scalar mathematical methods // TIntegral sum() const { return MVectorMethods::sum<TScalar, TIntegral>(*this); } TIntegral sumSquare() const { return MVectorMethods::sumSquare<TScalar, TIntegral>(*this); } TIntegral mean() const { return MVectorMethods::mean<TScalar, TIntegral>(*this); } TIntegral median() const { return MVectorMethods::median<TScalar, TIntegral>(*this); } TIntegral rms() const { return MVectorMethods::rms<TScalar, TIntegral>(*this); } TIntegral var() const { return MVectorMethods::var<TScalar, TIntegral>(*this); } TIntegral stdev() const { return MVectorMethods::stdev<TScalar, TIntegral>(*this); } TIntegral dotProduct(const MVector& vector) const { return MVectorMethods::dotProduct<TScalar, TIntegral>(*this, vector); } // method: norm // TIntegral norm() const { return (TIntegral)Integral::sqrt(dotProduct(*this)); } // method: distance // TIntegral distance(const MVector& vector) const { return (TIntegral)Integral::sqrt(distanceSquare(vector)); } TIntegral distanceSquare(const MVector& vector) const { return MVectorMethods::distanceSquare<TScalar, TIntegral>(*this, vector); } long numEqual(TIntegral test_value) const { return MVectorMethods::numEqual<TScalar, TIntegral>(*this, test_value); } long numNotEqual(TIntegral test_value) const {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -