26#ifndef _CXSC_RVECTOR_INL_INCLUDED
27#define _CXSC_RVECTOR_INL_INCLUDED
30#include "intvector.hpp"
52 INLINE
rvector::rvector(
const class index &i)
noexcept:l(1),u(i._int()),size(i._int())
54 dat=
new real[i._int()];
65 :l(i1),u(i2),size(i2-i1+1)
67 noexcept:l(i1),u(i2),size(i2-i1+1)
71 if(i1>i2) cxscthrow(ERROR_RVECTOR_WRONG_BOUNDARIES(
"rvector::rvector(const int &i1,const int &i2)"));
79 for(
int i=0, j=l-rs.l;i<size;i++,j++)
86 for (
int i=0;i<size;i++)
98 for(
int i=0;i<size;i++)
110 if(i<l||i>u) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real & rvector::operator [](const int &i) const"));
123 if(i<l||i>u) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real & rvector::operator [](const int &i)"));
136 if(i<start||i>end) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real & rvector_slice::operator [](const int &i)"));
149 if(i<start||i>end) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC(
"real & rvector_slice::operator [](const int &i) const"));
172 if(1<l||i>u) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rvector_slice rvector::operator ()(const int &i)"));
195 if(i1<l||i2>u) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rvector_slice rvector::operator ()(const int &i1,const int &i2)"));
208 if(1<start||i>end) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rvector_slice rvector_slice::operator ()(const int &i)"));
221 if(i1<start||i2>end) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG(
"rvector_slice rvector_slice::operator ()(const int &i1,const int &i2)"));
234 if(rv.size>1) cxscthrow(ERROR_RVECTOR_TYPE_CAST_OF_THICK_OBJ(
"real::real(const rvector &rv)"));
235 else if(rv.size<1) cxscthrow(ERROR_RVECTOR_USE_OF_UNINITIALIZED_OBJ(
"real::real(const rvector &rv)"));
248 if(sl.size>1) cxscthrow(ERROR_RVECTOR_TYPE_CAST_OF_THICK_OBJ(
"real::real(const rvector_slice &sl)"));
249 else if(sl.size<1) cxscthrow(ERROR_RVECTOR_USE_OF_UNINITIALIZED_OBJ(
"real::real(const rvector_slice &sl)"));
251 *
this=sl.dat[sl.start-sl.l];
256 INLINE rvector::operator
void*()
noexcept {
return _vvoid(*
this); }
264 {
return _vsvsassign<rvector_slice,rvector_slice>(*
this,sl); }
271 {
return _vsvassign<rvector_slice,rvector>(*
this,rv); }
273 INLINE rvector_slice::operator
void*()
noexcept {
return _vsvoid(*
this); }
290 { _vresize<class rvector,class real>(rv,len); }
297 { _vresize<class rvector,class real>(rv,lb,ub); }
301 INLINE
bool operator !(
const rvector &rv)
noexcept {
return _vnot(rv); }
302 INLINE
bool operator !(
const rvector_slice &sl)
noexcept {
return _vsnot(sl); }
330 {
return _vvmult<rvector,rvector,real>(rv1,rv2); }
337 {
return _vsvmult<rvector_slice,rvector,real>(sl,rv); }
344 {
return _vsvmult<rvector_slice,rvector,real>(sl,rv); }
351 {
return _vsvsmult<rvector_slice,rvector_slice,real>(sl1,sl2); }
361 {
return _vvplus<rvector,rvector,rvector>(rv1,rv2); }
368 {
return _vvsplus<rvector,rvector_slice,rvector>(rv,sl); }
375 {
return _vvsplus<rvector,rvector_slice,rvector>(rv,sl); }
382 {
return _vsvsplus<rvector_slice,rvector_slice,rvector>(sl1,sl2); }
389 {
return _vvplusassign(rv1,rv2); }
396 {
return _vvsplusassign(rv,sl); }
403 {
return _vsvplusassign(*
this,rv); }
410 {
return _vsvsplusassign(*
this,sl2); }
420 {
return _vvminus<rvector,rvector,rvector>(rv1,rv2); }
427 {
return _vvsminus<rvector,rvector_slice,rvector>(rv,sl); }
434 {
return _vsvminus<rvector_slice,rvector,rvector>(sl,rv); }
441 {
return _vsvsminus<rvector_slice,rvector_slice,rvector>(sl1,sl2); }
448 {
return _vvminusassign(rv1,rv2); }
455 {
return _vvsminusassign(rv,sl); }
462 {
return _vsvminusassign(*
this,rv); }
469 {
return _vsvsminusassign(*
this,sl2); }
471 INLINE
bool operator ==(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vveq(rv1,rv2); }
475 INLINE
bool operator !=(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vvneq(rv1,rv2); }
479 INLINE
bool operator <(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vvless(rv1,rv2); }
483 INLINE
bool operator <=(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vvleq(rv1,rv2); }
487 INLINE
bool operator >(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vvless(rv2,rv1); }
491 INLINE
bool operator >=(
const rvector &rv1,
const rvector &rv2)
noexcept {
return _vvleq(rv2,rv1); }
496 INLINE std::ostream &operator <<(std::ostream &s,
const rvector &rv)
noexcept {
return _vout(s,rv); }
497 INLINE std::ostream &operator <<(std::ostream &o,
const rvector_slice &sl)
noexcept {
return _vsout(o,sl); }
498 INLINE std::istream &operator >>(std::istream &s,
rvector &rv)
noexcept {
return _vin(s,rv); }
499 INLINE std::istream &operator >>(std::istream &s,
rvector_slice &rv)
noexcept {
return _vsin(s,rv); }
504 for(
int i=0 ; i<
VecLen(x) ; i++)
505 x[i+
Lb(x)] = (*this)[p[i+
Lb(p)]+
Lb(*
this)];
real(void) noexcept
Constructor of class real.
The Data Type rvector_slice.
rvector_slice & operator+=(const rvector &rv) noexcept
Implementation of addition and allocation operation.
real & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
rvector_slice & operator-=(const rvector &rv) noexcept
Implementation of subtraction and allocation operation.
rvector_slice & operator/=(const real &r) noexcept
Implementation of division and allocation operation.
rvector_slice & operator=(const rvector_slice &sl) noexcept
Implementation of standard assigning operator.
rvector_slice & operator()() noexcept
Operator for accessing the whole vector.
rvector_slice & operator*=(const real &r) noexcept
Implementation of multiplication and allocation operation.
rvector & operator=(const rvector &rv) noexcept
Implementation of standard assigning operator.
friend int VecLen(const rvector &rv) noexcept
Returns the dimension of the vector.
real & operator[](const int &i) const noexcept
Operator for accessing the single elements of the vector (read-only)
rvector & operator()() noexcept
Operator for accessing the whole vector.
rvector() noexcept
Constructor of class rvector.
friend int Lb(const rvector &rv) noexcept
Returns the lower bound of the vector.
The namespace cxsc, providing all functionality of the class library C-XSC.
int VecLen(const scimatrix_subv &S)
Returns the length of the subvector.
cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation operation.
rvector _rvector(const real &r) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
civector operator/(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of division operation.
int Ub(const cimatrix &rm, const int &i) noexcept
Returns the upper bound index.
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
ivector abs(const cimatrix_subv &mv) noexcept
Returns the absolute value of the matrix.
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
void Resize(cimatrix &A) noexcept
Resizes the matrix.
int Lb(const cimatrix &rm, const int &i) noexcept
Returns the lower bound index.
cimatrix & operator/=(cimatrix &m, const cinterval &c) noexcept
Implementation of division and allocation operation.