Here you can learn how to use operators with aff classes.
This test program gives an example of the usage of the following classes, functions, and preprocessor macros:
- See also
- tests/operatortest.cc
#define OPERATORTEST_VERSION \
"OPERATORTEST V1.1 test operator functions"
#include <iostream>
#include <complex>
using std::cout;
using std::cerr;
using std::endl;
void section(
const char* s,
const char l=
'-')
{
cout << endl << s << endl;
const char* p=s;
while (*p) { cout << l; ++p; }
cout << endl;
}
int main(
int iargc,
char* argv[])
{
section(
"Test array operators",
'=');
section(
"Normal array with unary operator");
section(
"Access through subarray");
section(
"test implicit type conversion");
section(
"test advanced type conversion");
CODE(C=std::complex<double>(14.,2.);)
section(
"test binary operator with constant input");
section(
"mixed implicit operations");
section(
"Test series operators",
'=');
DUMP((H *= G + 0.2) + 0.2);
}