42 #include <initializer_list> 91 std::vector< double > :: iterator
begin() {
return this->values.begin(); }
92 std::vector< double > :: iterator
end() {
return this->values.end(); }
93 std::vector< double > :: const_iterator
begin()
const {
return this->values.begin(); }
94 std::vector< double > :: const_iterator
end()
const {
return this->values.end(); }
106 inline FloatArray(std :: initializer_list< double >list) : values(list) { }
115 inline FloatArray &operator = (std :: initializer_list< double >list) { values = list;
return *
this; }
118 void push_back(
const double &iVal) {values.push_back(iVal);}
121 bool isFinite()
const;
131 inline double &
at(
int i) {
return values [ i - 1 ]; }
139 double at(
int i)
const;
141 inline double at(
int i)
const {
return values [ i - 1 ]; }
150 double &operator() (
int i);
151 double &operator[] (
int i);
153 inline double &operator() (
int i) {
156 inline double &operator[] (
int i) {
166 const double &operator() (
int i)
const;
167 const double &operator[] (
int i)
const;
169 inline const double &operator() (
int i)
const {
return values [ i ]; }
170 inline const double &operator[] (
int i)
const {
return values [ i ]; }
177 void checkBounds(
int i)
const;
183 void checkSizeTowards(
const IntArray &loc);
196 void resizeWithValues(
int s,
int allocChunk = 0);
206 void clear() { this->values.clear(); }
212 void hardResize(
int s);
216 bool containsOnlyZeroes()
const;
218 int giveSize()
const {
return (
int)this->values.size(); }
222 bool isEmpty()
const {
return this->values.empty(); }
231 virtual void printYourself()
const;
236 virtual void printYourself(
const std::string &name)
const;
242 virtual void printYourselfToFile(
const std::string filename,
const bool showDimensions=
true)
const;
246 virtual void pY()
const;
258 void append(
double a);
310 void add(
double offset);
321 void times(
double s);
361 void addSubVector(
const FloatArray &src,
int si);
384 void copySubVector(
const FloatArray &src,
int si);
399 double distance(
const FloatArray &iP1,
const FloatArray &iP2,
double &oXi,
double &oXiUnbounded)
const;
400 double distance_square(
const FloatArray &iP1,
const FloatArray &iP2,
double &oXi,
double &oXiUnbounded)
const;
406 double distance_square(
const FloatArray &x)
const;
410 int giveIndexMinElem(
void);
414 int giveIndexMaxElem(
void);
427 double dotProduct(
const FloatArray &x,
int size)
const;
439 double computeNorm()
const;
445 double computeSquaredNorm()
const;
455 double product()
const;
469 inline const double *
givePointer()
const {
return values.data(); }
484 void beSymVectorFormOfStrain(
const FloatMatrix &aMatrix);
490 void changeComponentOrder();
496 void power(
const double exponent);
518 void __setitem__(
int i,
double val) { this->values[i] = val; }
519 double __getitem__(
int i) {
return this->values[i]; }
520 void beCopyOf(
const FloatArray &src) { this->operator = ( src ); }
528 FloatArray &
operator *= ( FloatArray & x,
const double & a );
530 FloatArray
operator *(
const double & a,
const FloatArray & x );
531 FloatArray
operator *(
const FloatArray & x,
const double & a );
532 FloatArray
operator + (
const FloatArray & x,
const FloatArray & y );
533 FloatArray
operator - (
const FloatArray & x,
const FloatArray & y );
534 FloatArray &
operator += ( FloatArray & x,
const FloatArray & y );
535 FloatArray &
operator -= ( FloatArray & x,
const FloatArray & y );
537 double norm(
const FloatArray &x);
538 double dot(
const FloatArray &x,
const FloatArray &y);
541 #endif // floatarray_h double distance(const FloatArray *x) const
std::vector< double > values
Stored values.
FloatArray & operator*=(FloatArray &x, const double &a)
Vector multiplication by scalar.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
double & at(int i)
Coefficient access function.
void clear()
Clears receiver (zero size).
FloatArray(int n=0)
Constructor for sized array. Data is zeroed.
FloatArray & operator-=(FloatArray &x, const FloatArray &y)
double at(int i) const
Coefficient access function.
Class implementing an array of integers.
std::vector< double >::const_iterator begin() const
FloatArray(const FloatArray &src)
Copy constructor. Creates the array from another array.
FloatArray(std::initializer_list< double >list)
Initializer list constructor.
std::vector< double >::const_iterator end() const
std::ostream & operator<<(std::ostream &out, const Dictionary &r)
FloatArray(FloatArray &&src)
Move constructor. Creates the array from another array.
bool isEmpty() const
Returns true if receiver is empty.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
double norm(const FloatArray &x)
virtual ~FloatArray()
Destructor.
const FloatArray ZeroVector
const double * givePointer() const
Gives the pointer to the raw data, breaking encapsulation.
std::vector< double >::iterator end()
FloatArray operator*(const double &a, const FloatArray &x)
FloatArray operator-(const FloatArray &x, const FloatArray &y)
void push_back(const double &iVal)
Add one element.
FloatArray & operator+=(FloatArray &x, const FloatArray &y)
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
FloatArray operator+(const FloatArray &x, const FloatArray &y)
double dot(const FloatArray &x, const FloatArray &y)
std::vector< double >::iterator begin()