ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
tpl_ops_< N, I > Struct Template Reference

#include <nu1_tpl.h>

Public Member Functions

template<typename T >
bool operator_lt (T const *a, T const *b) const
 
template<typename T >
bool operator_gt (T const *a, T const *b) const
 
template<typename T >
bool operator_eq (T const *a, T const *b) const
 
template<typename T >
void operator_plus (T const *a, T const *b, T *c) const
 
template<typename T >
void operator_uminus (T const *a, T *b) const
 
template<typename T >
void operator_div (T const *a, T *b, int n) const
 

Detailed Description

template<int N, int I>
struct tpl_ops_< N, I >

Definition at line 136 of file nu1_tpl.h.

Member Function Documentation

template<int N, int I>
template<typename T >
void tpl_ops_< N, I >::operator_div ( T const *  a,
T *  b,
int  n 
) const
inline

Definition at line 184 of file nu1_tpl.h.

185  {
186  b[I] = a[I]/n;
187  tpl_ops_<N, I+1>().operator_div(a, b, n);
188  }
void operator_div(T const *a, T *b, int n) const
Definition: nu1_tpl.h:184
template<int N, int I>
template<typename T >
bool tpl_ops_< N, I >::operator_eq ( T const *  a,
T const *  b 
) const
inline

Definition at line 161 of file nu1_tpl.h.

162  {
163  if (a[I] != b[I])
164  return false;
165  else
166  return tpl_ops_<N, I+1>().operator_eq(a, b);
167  }
bool operator_eq(T const *a, T const *b) const
Definition: nu1_tpl.h:161
template<int N, int I>
template<typename T >
bool tpl_ops_< N, I >::operator_gt ( T const *  a,
T const *  b 
) const
inline

Definition at line 150 of file nu1_tpl.h.

151  {
152  if (a[I] > b[I])
153  return true;
154  else if (a[I] < b[I])
155  return false;
156  else
157  return tpl_ops_<N, I+1>().operator_gt(a, b);
158  }
bool operator_gt(T const *a, T const *b) const
Definition: nu1_tpl.h:150
template<int N, int I>
template<typename T >
bool tpl_ops_< N, I >::operator_lt ( T const *  a,
T const *  b 
) const
inline

Definition at line 139 of file nu1_tpl.h.

140  {
141  if (a[I] < b[I])
142  return true;
143  else if (a[I] > b[I])
144  return false;
145  else
146  return tpl_ops_<N, I+1>().operator_lt(a, b);
147  }
bool operator_lt(T const *a, T const *b) const
Definition: nu1_tpl.h:139
template<int N, int I>
template<typename T >
void tpl_ops_< N, I >::operator_plus ( T const *  a,
T const *  b,
T *  c 
) const
inline

Definition at line 170 of file nu1_tpl.h.

171  {
172  c[I] = a[I] + b[I];
173  tpl_ops_<N, I+1>().operator_plus(a, b, c);
174  }
void operator_plus(T const *a, T const *b, T *c) const
Definition: nu1_tpl.h:170
template<int N, int I>
template<typename T >
void tpl_ops_< N, I >::operator_uminus ( T const *  a,
T *  b 
) const
inline

Definition at line 177 of file nu1_tpl.h.

178  {
179  b[I] = -a[I];
181  }
void operator_uminus(T const *a, T *b) const
Definition: nu1_tpl.h:177

The documentation for this struct was generated from the following file: