11 #ifndef INDEX_INLINES_H
12 #define INDEX_INLINES_H
71 else if ( (l>f) ^ (s<0) ) {
88 BaseFirst( b.BaseFirst ),
98 BaseFirst(b->BaseFirst),
164 return Index(1,off,i);
169 return Index(1,off,i);
174 return Index(1,-off,i);
179 return Index(-1,off,i);
184 return Index(-1,0,i);
270 bool quicktest = (a0 <= b0 && a1 >= b1);
271 if (!quicktest || s == 1)
279 return (t % s == 0) && ((b0-
a0) % s == 0) && ((a1-b1) % s == 0);
295 int mid = first + length/2 - 1;
296 l =
Index(first, mid);
297 r =
Index(mid+1,first+length-1);
315 int mid = first +
static_cast<int>(length*a+0.5) - 1;
316 l =
Index(first, mid);
317 r =
Index(mid+1,first+length-1);
324 #define INDEX_PETE_DOUBLE_OPERATOR(OP,APP) \
327 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<double> > \
328 OP ( const Index& idx, double x ) \
331 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<double> > \
333 return Return_t( idx.MakeExpression(), PETE_Scalar<double>(x) ); \
337 PETE_TBTree< APP , PETE_Scalar<double> , Index::PETE_Expr_t > \
338 OP ( double x , const Index& idx ) \
341 PETE_TBTree< APP , PETE_Scalar<double> , Index::PETE_Expr_t > \
343 return Return_t( PETE_Scalar<double>(x) , idx.MakeExpression()); \
362 #undef INDEX_PETE_DOUBLE_OPERATOR
366 #define INDEX_PETE_FLOAT_OPERATOR(OP,APP) \
369 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<float> > \
370 OP ( const Index& idx, float x ) \
373 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<float> > \
375 return Return_t( idx.MakeExpression(), PETE_Scalar<float>(x) ); \
379 PETE_TBTree< APP , PETE_Scalar<float> , Index::PETE_Expr_t > \
380 OP ( float x , const Index& idx ) \
383 PETE_TBTree< APP , PETE_Scalar<float> , Index::PETE_Expr_t > \
385 return Return_t( PETE_Scalar<float>(x) , idx.MakeExpression()); \
404 #undef INDEX_PETE_FLOAT_OPERATOR
408 #define INDEX_PETE_INT_OPERATOR(OP,APP) \
411 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<int> > \
412 OP ( const Index& idx, int x ) \
415 PETE_TBTree< APP , Index::PETE_Expr_t , PETE_Scalar<int> > \
417 return Return_t( idx.MakeExpression(), PETE_Scalar<int>(x) ); \
421 PETE_TBTree< APP , PETE_Scalar<int> , Index::PETE_Expr_t > \
422 OP ( int x , const Index& idx ) \
425 PETE_TBTree< APP , PETE_Scalar<int> , Index::PETE_Expr_t > \
427 return Return_t( PETE_Scalar<int>(x) , idx.MakeExpression()); \
442 #undef INDEX_PETE_INT_OPERATOR
446 #endif // INDEX_INLINES_H
unsigned int length() const
double Min(double a, double b)
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
bool contains(const Index &a) const
#define INDEX_PETE_INT_OPERATOR(OP, APP)
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
Index plugBase(const Index &) const
bool touches(const Index &a) const
bool sameBase(const Index &) const
bool lt(double x, double y)
bool gt(double x, double y)
double Max(double a, double b)
bool ge(double x, double y)
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
#define INDEX_PETE_DOUBLE_OPERATOR(OP, APP)
bool eq(double x, double y)
PETE_TBTree< OpNE, Index::PETE_Expr_t, PETE_Scalar< double > > ne(const Index &idx, double x)
bool le(double x, double y)
#define INDEX_PETE_FLOAT_OPERATOR(OP, APP)
bool split(Index &l, Index &r) const
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
bool containsAllPoints(const Index &b) const
constexpr double a0
Bohr radius in m.