mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-10 19:36:56 +01:00
Merge branch 'develop' into feature/hmc_generalise
This commit is contained in:
@ -123,6 +123,11 @@ class iScalar {
|
||||
friend strong_inline void rotate(iScalar<vtype> &out,const iScalar<vtype> &in,int rot){
|
||||
rotate(out._internal,in._internal,rot);
|
||||
}
|
||||
friend strong_inline void exchange(iScalar<vtype> &out1,iScalar<vtype> &out2,
|
||||
const iScalar<vtype> &in1,const iScalar<vtype> &in2,int type){
|
||||
exchange(out1._internal,out2._internal,
|
||||
in1._internal, in2._internal,type);
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iScalar<vtype> operator-(const iScalar<vtype> &r) {
|
||||
@ -284,6 +289,13 @@ class iVector {
|
||||
rotate(out._internal[i],in._internal[i],rot);
|
||||
}
|
||||
}
|
||||
friend strong_inline void exchange(iVector<vtype,N> &out1,iVector<vtype,N> &out2,
|
||||
const iVector<vtype,N> &in1,const iVector<vtype,N> &in2,int type){
|
||||
for(int i=0;i<N;i++){
|
||||
exchange(out1._internal[i],out2._internal[i],
|
||||
in1._internal[i], in2._internal[i],type);
|
||||
}
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iVector<vtype, N> operator-(const iVector<vtype, N> &r) {
|
||||
@ -433,6 +445,14 @@ class iMatrix {
|
||||
rotate(out._internal[i][j],in._internal[i][j],rot);
|
||||
}}
|
||||
}
|
||||
friend strong_inline void exchange(iMatrix<vtype,N> &out1,iMatrix<vtype,N> &out2,
|
||||
const iMatrix<vtype,N> &in1,const iMatrix<vtype,N> &in2,int type){
|
||||
for(int i=0;i<N;i++){
|
||||
for(int j=0;j<N;j++){
|
||||
exchange(out1._internal[i][j],out2._internal[i][j],
|
||||
in1._internal[i][j], in2._internal[i][j],type);
|
||||
}}
|
||||
}
|
||||
|
||||
// Unary negation
|
||||
friend strong_inline iMatrix<vtype, N> operator-(const iMatrix<vtype, N> &r) {
|
||||
|
51
lib/tensors/Tensors.h
Normal file
51
lib/tensors/Tensors.h
Normal file
@ -0,0 +1,51 @@
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: ./lib/Tensors.h
|
||||
|
||||
Copyright (C) 2015
|
||||
|
||||
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
||||
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
Author: neo <cossu@post.kek.jp>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#ifndef GRID_MATH_H
|
||||
#define GRID_MATH_H
|
||||
|
||||
#include <Grid/tensors/Tensor_traits.h>
|
||||
#include <Grid/tensors/Tensor_class.h>
|
||||
#include <Grid/tensors/Tensor_arith.h>
|
||||
#include <Grid/tensors/Tensor_inner.h>
|
||||
#include <Grid/tensors/Tensor_outer.h>
|
||||
#include <Grid/tensors/Tensor_transpose.h>
|
||||
#include <Grid/tensors/Tensor_trace.h>
|
||||
#include <Grid/tensors/Tensor_index.h>
|
||||
#include <Grid/tensors/Tensor_Ta.h>
|
||||
#include <Grid/tensors/Tensor_determinant.h>
|
||||
#include <Grid/tensors/Tensor_exp.h>
|
||||
//#include <Grid/tensors/Tensor_peek.h>
|
||||
//#include <Grid/tensors/Tensor_poke.h>
|
||||
#include <Grid/tensors/Tensor_reality.h>
|
||||
#include <Grid/tensors/Tensor_unary.h>
|
||||
#include <Grid/tensors/Tensor_extract_merge.h>
|
||||
#include <Grid/tensors/Tensor_logical.h>
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user