14#define StiffArrayConstr_D 0
15#define StiffArrayDestr_D 0
28 template<u
int dim,
class F>
54 F* d = data_;
const H* e = (
const H*)a;
55 for(
uint i = dim; i--;) *d++ =
fnc(*e++);
65 F* d = data_;
const H* e = (
const H*)a;
66 for(
uint i = dim; i--;) *d++ =
fnc(*e++);
70 std::memcpy(data_, a.data_, dim*
sizeof(F));
73 DEBUGL(StiffArrayDestr_D,
"data = " << data_);
75 DEBUGL(StiffArrayDestr_D,
"done.");
77 uint length() {
return dim; }
79 void zeros() { std::memset(data_, 0, dim*
sizeof(F)); }
81 operator F*() {
return data_; }
83 operator const F*()
const {
return data_; }
85 F*
data() {
return data_; }
87 const F*
data()
const {
return data_; }
97 "i = " << i <<
", dim = " << dim);
103 "i = " << i <<
", dim = " << dim);
109 F* d = data_;
for(
uint i = dim; i--;) *d++ *= n;
114 F* d = data_;
for(
uint i = dim; i--;) *d++ /= n;
119 F* d = data_;
for(
uint i = dim; i--;) *d++ = n;
124 F* d = data_;
for(
uint i = dim; i--;) *d++ += n;
129 F* d = data_;
for(
uint i = dim; i--;) *d++ -= n;
134 F* d = data_;
const F* e = (
const F*)a;
135 for(
uint i = dim; i--;) *d++ *= *e++;
141 F* d = data_;
for(
uint i = dim; i--;) *d =
fnc(*d++);
145 virtual std::ostream&
info(std::ostream&
os)
const;
151 template<u
int dim,
class F>
155 for (
uint i = dim; i--;)
156 os << *d++ << ((i == 0) ?
"" :
", ");
192 DEBUGL(StiffArrayDestr_D,
"done.");
194 uint length() {
return 1; }
198 operator F()
const {
return data_; }
213 data_ *= n;
return *
this;
217 data_ /= n;
return *
this;
221 data_ = n;
return *
this;
225 data_ += n;
return *
this;
229 data_ -= n;
return *
this;
234 data_ =
fnc(data_);
return *
this;
237 virtual std::ostream&
info(std::ostream&
os)
const;
#define conceptsException(exc)
StiffArray< 1, F > & operator*=(const F n)
Scaling operator.
void zeros()
Fills the memory with zeros.
StiffArray(const StiffArray< 1, H > &a, F fnc(const H &))
StiffArray(const Array< F > &dft)
StiffArray< 1, F > & operator=(const F n)
Assignement operator.
StiffArray< 1, F > & operator/=(const F n)
Division operator.
StiffArray< 1, F > & operator+=(const F n)
Addition operator.
StiffArray< 1, F > & apply(F &fnc(F &))
StiffArray< 1, F > & operator-=(const F n)
Subtraction operator.
StiffArray(const StiffArray< 1, F > &a)
Copy constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
StiffArray(const StiffArray< dim, H > &a, const F &fnc(const H &))
StiffArray(const StiffArray< dim, H > &a, F fnc(const H &))
StiffArray< dim, F > & apply(F &fnc(F &))
const F & operator[](const int i) const
Index operator.
StiffArray(const StiffArray< dim, F > &a)
Copy constructor.
void zeros()
Fills the memory with zeros.
F * data()
Returns a pointer to the data in the array.
const F * data() const
Returns a pointer to the data in the array.
StiffArray< dim, F > & operator=(const F n)
Assignement operator.
StiffArray< dim, F > & operator*=(const StiffArray< dim, F > &a)
Multiplication operator.
StiffArray< dim, F > & operator-=(const F n)
Subtraction operator.
StiffArray< dim, F > & operator*=(const F n)
Scaling operator.
StiffArray< dim, F > & operator/=(const F n)
Division operator.
StiffArray(const Array< F > &dft)
StiffArray< dim, F > & operator+=(const F n)
Addition operator.
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
#define conceptsAssert3(cond, exc, msg)
std::string typeOf(const T &t)
void memorycpy(F *dest, const G *src, size_t n)
Copies n entries from src to dest (faster than std::memcpy)
Set< F > makeSet(uint n, const F &first,...)