aclVectorOfElementsOperations.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ACLVECTORELEMENTSOPERATIONS_H
#define ACLVECTORELEMENTSOPERATIONS_H
#include "aclVectorOfElementsDef.h"
namespace acl
{
class ElementBase;
class MemBlock;
class KernelConfiguration;
typedef std::shared_ptr<ElementBase> Element;
typedef std::shared_ptr<MemBlock> ElementData;
class VectorOfElements;
typedef shared_ptr<VectorOfElementsData> SPVectorOfElementsData;
typedef shared_ptr<VectorOfElements> SPVectorOfElements;
VectorOfElementsData clone(VectorOfElementsData a);
VectorOfElementsData clone(VectorOfElementsData a, unsigned int n);
void initData(VectorOfElements a,
VectorOfElements initializationValue,
const KernelConfiguration & kernelConfig);
void initData(VectorOfElements a,
VectorOfElements initializationValue);
void copy(const vector<Element> & source,
VectorOfElements & destination);
void copy(const vector<ElementData> & source,
VectorOfElements & destination);
void copy(const vector<Element> & source,
VectorOfElements & destination, unsigned int start, unsigned int end);
void copy(const VectorOfElementsData & source,
VectorOfElementsData & destination);
VectorOfElements subVE(const VectorOfElements & source,
unsigned int start,
unsigned int end);
VectorOfElements subVE(const VectorOfElements & source,
unsigned int i);
VectorOfElements subVE(const VectorOfElements & source,
const vector<unsigned int> & iList);
VectorOfElementsData subVE(const VectorOfElementsData & source,
unsigned int start,
unsigned int end);
void swapBuffers(const VectorOfElementsData & a,
const VectorOfElementsData & b);
VectorOfElements assignmentSafe(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator-(const VectorOfElements & a);
VectorOfElements operator+=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator-=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator*=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator/=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator+(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator-(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator*(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator/(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator%(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator==(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator!=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator>(const VectorOfElements & a, const VectorOfElements & b);
VectorOfElements operator<(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator<=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator>=(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator&&(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator||(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements operator!(const VectorOfElements & a);
VectorOfElements crossProduct(const VectorOfElements & a,
const VectorOfElements & b);
inline VectorOfElements l2(const VectorOfElements & a);
VectorOfElements productOfElements(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements productOfElements(const VectorOfElements & a);
VectorOfElements divisionOfElements(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements min(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements min(const VectorOfElements & a,
const VectorOfElements & b,
TypeID type);
VectorOfElements minAbs(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements max(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements max(const VectorOfElements & a,
const VectorOfElements & b,
TypeID type);
VectorOfElements copysign(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElements copysign(const VectorOfElements & a,
const VectorOfElements & b,
TypeID t);
VectorOfElements sign(const VectorOfElements & a);
VectorOfElements excerpt(const VectorOfElements & source,
const VectorOfElements & filter);
VectorOfElements select(const VectorOfElements & a,
const VectorOfElements & b,
const VectorOfElements & c);
VectorOfElements select(const VectorOfElements & a,
const VectorOfElements & b,
const VectorOfElements & c,
TypeID t);
VectorOfElements select(const VectorOfElements & b,
const VectorOfElements & c,
TypeID t);
VectorOfElements mad(const VectorOfElements & a,
const VectorOfElements & b,
const VectorOfElements & c);
VectorOfElements mad(const VectorOfElements & a,
const VectorOfElements & b,
const VectorOfElements & c,
TypeID t);
VectorOfElements log(const VectorOfElements & a);
VectorOfElements log10(const VectorOfElements & a);
VectorOfElements powI(const VectorOfElements & a, unsigned int i);
VectorOfElements exp(const VectorOfElements & a);
VectorOfElements sqrt(const VectorOfElements & a);
VectorOfElements rsqrt(const VectorOfElements & a);
VectorOfElements fabs(const VectorOfElements & a);
VectorOfElements abs(const VectorOfElements & a);
VectorOfElements abs_diff(const VectorOfElements & a, const VectorOfElements & b);
VectorOfElements floor(const VectorOfElements & a);
VectorOfElements convert(acl::TypeID type, const VectorOfElements & a, bool strong=true);
VectorOfElements minElement(const VectorOfElements & a);
VectorOfElements minAbsElement(const VectorOfElements & a);
VectorOfElements maxElement(const VectorOfElements & a);
VectorOfElements sumOfElements(const VectorOfElements & a);
VectorOfElements andOfElements(const VectorOfElements & a);
VectorOfElements orOfElements(const VectorOfElements & a);
VectorOfElements cat(const VectorOfElements & a,
const VectorOfElements & b);
VectorOfElementsData cat(const VectorOfElementsData & a,
const VectorOfElementsData & b);
VectorOfElements cat(const VectorOfElements & a,
const VectorOfElements & b,
const VectorOfElements & c);
VectorOfElements cat(const VectorOfElements * a,
unsigned int n);
VectorOfElements catN(const VectorOfElements & a,
unsigned int n);
template <typename T> VectorOfElements operator+=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator-=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator*=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator/=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator+(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator+(const T & a,
const VectorOfElements & b);
template <typename T> VectorOfElements operator-(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator-(const T & a,
const VectorOfElements & b);
template <typename T> VectorOfElements operator*(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator*(const T & a,
const VectorOfElements & b);
template <typename T> VectorOfElements operator/(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator%(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator/(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator%(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator>(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator>(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator<(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator<(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator>=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator>=(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator<=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator<=(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator==(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator==(const T & b,
const VectorOfElements & a);
template <typename T> VectorOfElements operator!=(const VectorOfElements & a,
const T & b);
template <typename T> VectorOfElements operator!=(const T & b,
const VectorOfElements & a);
vector<Element> gcNormalize(const VectorOfElements & a);
vector<Element> gcLength2(const VectorOfElements & a, const VectorOfElements & l2);
vector<Element> gcLength(const VectorOfElements & a, const VectorOfElements & l);
//------------------------------ Implementation ----------------
inline VectorOfElements l2(const VectorOfElements & a)
{
return a * a;
}
} //namespace acl
#endif // ACLVECTORELEMENTSOPERATIONS_H
acl::KernelConfiguration
ACL Kernel configuration class.
Definition: aclKernelConfiguration.h:35
acl::VectorOfElementsData
The class represents several ElementData.
Definition: aclVectorOfElementsDef.h:57
acl::VectorOfElementsData::clone
VectorOfElementsData clone(VectorOfElementsData a)
acl::VectorOfElementsData::clone
VectorOfElementsData clone(VectorOfElementsData a, unsigned int n)
acl::VectorOfElementsData::swapBuffers
void swapBuffers(const VectorOfElementsData &a, const VectorOfElementsData &b)
acl::VectorOfElements
The class represents several Element.
Definition: aclVectorOfElementsDef.h:92
acl::VectorOfElements::copy
void copy(const vector< Element > &source, VectorOfElements &destination, unsigned int start, unsigned int end)
Copies the VectorOfElements class.
acl::VectorOfElements::initData
void initData(VectorOfElements a, VectorOfElements initializationValue, const KernelConfiguration &kernelConfig)
acl::VectorOfElements::initData
void initData(VectorOfElements a, VectorOfElements initializationValue)
acl::VectorOfElements::copy
void copy(const vector< ElementData > &source, VectorOfElements &destination)
Copies the VectorOfElements class.
acl::VectorOfElements::subVE
VectorOfElements subVE(const VectorOfElements &source, unsigned int start, unsigned int end)
acl::VectorOfElements::subVE
VectorOfElements subVE(const VectorOfElements &source, unsigned int i)
acl::VectorOfElements::subVE
VectorOfElements subVE(const VectorOfElements &source, const vector< unsigned int > &iList)
acl::VectorOfElements::subVE
VectorOfElementsData subVE(const VectorOfElementsData &source, unsigned int start, unsigned int end)
acl::VectorOfElements::operator!=
VectorOfElements operator!=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::minAbsElement
VectorOfElements minAbsElement(const VectorOfElements &a)
acl::VectorOfElements::fabs
VectorOfElements fabs(const VectorOfElements &a)
acl::VectorOfElements::operator!=
VectorOfElements operator!=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator*
VectorOfElements operator*(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::assignmentSafe
VectorOfElements assignmentSafe(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator<
VectorOfElements operator<(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator!
VectorOfElements operator!(const VectorOfElements &a)
acl::VectorOfElements::copysign
VectorOfElements copysign(const VectorOfElements &a, const VectorOfElements &b, TypeID t)
acl::VectorOfElements::sqrt
VectorOfElements sqrt(const VectorOfElements &a)
acl::VectorOfElements::operator<
VectorOfElements operator<(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator+=
VectorOfElements operator+=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator/
VectorOfElements operator/(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator>=
VectorOfElements operator>=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::floor
VectorOfElements floor(const VectorOfElements &a)
acl::VectorOfElements::abs
VectorOfElements abs(const VectorOfElements &a)
acl::VectorOfElements::operator==
VectorOfElements operator==(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator>=
VectorOfElements operator>=(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator-
VectorOfElements operator-(const VectorOfElements &a, const T &b)
acl::VectorOfElements::abs_diff
VectorOfElements abs_diff(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator-
VectorOfElements operator-(const VectorOfElements &a)
acl::VectorOfElements::crossProduct
VectorOfElements crossProduct(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator*=
VectorOfElements operator*=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::log10
VectorOfElements log10(const VectorOfElements &a)
acl::VectorOfElements::operator%
VectorOfElements operator%(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator-=
VectorOfElements operator-=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator-=
VectorOfElements operator-=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator+
VectorOfElements operator+(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator*=
VectorOfElements operator*=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator*
VectorOfElements operator*(const T &a, const VectorOfElements &b)
acl::VectorOfElements::operator!=
VectorOfElements operator!=(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator+
VectorOfElements operator+(const T &a, const VectorOfElements &b)
acl::VectorOfElements::productOfElements
VectorOfElements productOfElements(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator/=
VectorOfElements operator/=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::catN
VectorOfElements catN(const VectorOfElements &a, unsigned int n)
acl::VectorOfElements::minElement
VectorOfElements minElement(const VectorOfElements &a)
acl::VectorOfElements::convert
VectorOfElements convert(acl::TypeID type, const VectorOfElements &a, bool strong=true)
acl::VectorOfElements::operator/
VectorOfElements operator/(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator+=
VectorOfElements operator+=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::select
VectorOfElements select(const VectorOfElements &b, const VectorOfElements &c, TypeID t)
acl::VectorOfElements::cat
VectorOfElementsData cat(const VectorOfElementsData &a, const VectorOfElementsData &b)
acl::VectorOfElements::operator+
VectorOfElements operator+(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::max
VectorOfElements max(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator%
VectorOfElements operator%(const T &b, const VectorOfElements &a)
acl::VectorOfElements::min
VectorOfElements min(const VectorOfElements &a, const VectorOfElements &b, TypeID type)
acl::VectorOfElements::exp
VectorOfElements exp(const VectorOfElements &a)
acl::VectorOfElements::select
VectorOfElements select(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
acl::VectorOfElements::max
VectorOfElements max(const VectorOfElements &a, const VectorOfElements &b, TypeID type)
acl::VectorOfElements::operator||
VectorOfElements operator||(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::sign
VectorOfElements sign(const VectorOfElements &a)
acl::VectorOfElements::cat
VectorOfElements cat(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::sumOfElements
VectorOfElements sumOfElements(const VectorOfElements &a)
acl::VectorOfElements::mad
VectorOfElements mad(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c, TypeID t)
acl::VectorOfElements::productOfElements
VectorOfElements productOfElements(const VectorOfElements &a)
acl::VectorOfElements::divisionOfElements
VectorOfElements divisionOfElements(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::cat
VectorOfElements cat(const VectorOfElements *a, unsigned int n)
acl::VectorOfElements::rsqrt
VectorOfElements rsqrt(const VectorOfElements &a)
acl::VectorOfElements::log
VectorOfElements log(const VectorOfElements &a)
acl::VectorOfElements::operator<
VectorOfElements operator<(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator>
VectorOfElements operator>(const VectorOfElements &a, const T &b)
acl::VectorOfElements::excerpt
VectorOfElements excerpt(const VectorOfElements &source, const VectorOfElements &filter)
acl::VectorOfElements::operator/
VectorOfElements operator/(const T &b, const VectorOfElements &a)
acl::VectorOfElements::cat
VectorOfElements cat(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
acl::VectorOfElements::operator==
VectorOfElements operator==(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::min
VectorOfElements min(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator-
VectorOfElements operator-(const T &a, const VectorOfElements &b)
acl::VectorOfElements::minAbs
VectorOfElements minAbs(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator%
VectorOfElements operator%(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator<=
VectorOfElements operator<=(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator-
VectorOfElements operator-(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::select
VectorOfElements select(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c, TypeID t)
acl::VectorOfElements::operator*
VectorOfElements operator*(const VectorOfElements &a, const T &b)
acl::VectorOfElements::copysign
VectorOfElements copysign(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::powI
VectorOfElements powI(const VectorOfElements &a, unsigned int i)
acl::VectorOfElements::mad
VectorOfElements mad(const VectorOfElements &a, const VectorOfElements &b, const VectorOfElements &c)
acl::VectorOfElements::orOfElements
VectorOfElements orOfElements(const VectorOfElements &a)
acl::VectorOfElements::andOfElements
VectorOfElements andOfElements(const VectorOfElements &a)
acl::VectorOfElements::maxElement
VectorOfElements maxElement(const VectorOfElements &a)
acl::VectorOfElements::operator==
VectorOfElements operator==(const VectorOfElements &a, const T &b)
acl::VectorOfElements::operator>
VectorOfElements operator>(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator<=
VectorOfElements operator<=(const T &b, const VectorOfElements &a)
acl::VectorOfElements::operator<=
VectorOfElements operator<=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator&&
VectorOfElements operator&&(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator>
VectorOfElements operator>(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator/=
VectorOfElements operator/=(const VectorOfElements &a, const VectorOfElements &b)
acl::VectorOfElements::operator>=
VectorOfElements operator>=(const VectorOfElements &a, const T &b)
type
acl::TypeID type(acl::typeToTypeID< FlT >())
acl
Advanced Computational Language.
Definition: acl.h:41
acl::SPVectorOfElementsData
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
Definition: aclVectorOfElementsDef.h:105
acl::l2
VectorOfElements l2(const VectorOfElements &a)
Definition: aclVectorOfElementsOperations.h:751
acl::gcLength2
vector< Element > gcLength2(const VectorOfElements &a, const VectorOfElements &l2)
generates code corresponding . Result will be stored in l2
acl::copy
void copy(MemBlock &source, T *destination)
acl::TypeID
TypeID
Definition: aclTypes.h:39
acl::gcLength
vector< Element > gcLength(const VectorOfElements &a, const VectorOfElements &l)
generates code corresponding . Result will be stored in l
acl::gcNormalize
vector< Element > gcNormalize(const VectorOfElements &a)
generates code corresponding
acl::ElementData
std::shared_ptr< MemBlock > ElementData
Definition: acl.h:47
acl::SPVectorOfElements
shared_ptr< VectorOfElements > SPVectorOfElements
Definition: aclVectorOfElementsDef.h:106
acl::Element
std::shared_ptr< ElementBase > Element
Definition: acl.h:49
aclVectorOfElementsDef.h