本文整理汇总了C++中IndexDependentFill函数的典型用法代码示例。如果您正苦于以下问题:C++ IndexDependentFill函数的具体用法?C++ IndexDependentFill怎么用?C++ IndexDependentFill使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IndexDependentFill函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GCDMatrix
void GCDMatrix( AbstractDistMatrix<T>& G, Int m, Int n )
{
DEBUG_ONLY(CSE cse("GCDMatrix"))
G.Resize( m, n );
auto gcdFill = []( Int i, Int j ) { return T(GCD(i+1,j+1)); };
IndexDependentFill( G, function<T(Int,Int)>(gcdFill) );
}
示例2: MinIJ
void MinIJ( AbstractDistMatrix<T>& M, Int n )
{
DEBUG_ONLY(CSE cse("MinIJ"))
M.Resize( n, n );
auto minIJFill = []( Int i, Int j ) { return T(Min(i+1,j+1)); };
IndexDependentFill( M, function<T(Int,Int)>(minIJFill) );
}
示例3: Hilbert
void Hilbert( AbstractDistMatrix<F>& A, Int n )
{
DEBUG_ONLY(CSE cse("Hilbert"))
A.Resize( n, n );
auto hilbertFill = []( Int i, Int j ) { return F(1)/F(i+j+1); };
IndexDependentFill( A, function<F(Int,Int)>(hilbertFill) );
}
示例4: Parter
void Parter( AbstractBlockDistMatrix<F>& P, Int n )
{
DEBUG_ONLY(CallStackEntry cse("Parter"))
P.Resize( n, n );
const F oneHalf = F(1)/F(2);
auto parterFill = [=]( Int i, Int j ) { return F(1)/(F(i)-F(j)+oneHalf); };
IndexDependentFill( P, function<F(Int,Int)>(parterFill) );
}
示例5: Ris
void Ris( AbstractBlockDistMatrix<F>& R, Int n )
{
DEBUG_ONLY(CallStackEntry cse("Ris"))
R.Resize( n, n );
const F oneHalf = F(1)/F(2);
auto risFill = [=]( Int i, Int j ) { return oneHalf/(F(n-i-j)-oneHalf); };
IndexDependentFill( R, function<F(Int,Int)>(risFill) );
}
示例6: Ris
void Ris( AbstractDistMatrix<F>& R, Int n )
{
DEBUG_CSE
R.Resize( n, n );
const F oneHalf = F(1)/F(2);
auto risFill = [=]( Int i, Int j ) { return oneHalf/(F(n-i-j)-oneHalf); };
IndexDependentFill( R, function<F(Int,Int)>(risFill) );
}
示例7: Parter
void Parter( AbstractDistMatrix<F>& P, Int n )
{
EL_DEBUG_CSE
P.Resize( n, n );
const F oneHalf = F(1)/F(2);
auto parterFill = [=]( Int i, Int j ) { return F(1)/(F(i)-F(j)+oneHalf); };
IndexDependentFill( P, function<F(Int,Int)>(parterFill) );
}
示例8: Lehmer
void Lehmer( AbstractDistMatrix<F>& L, Int n )
{
DEBUG_ONLY(CSE cse("Lehmer"))
L.Resize( n, n );
auto lehmerFill =
[]( Int i, Int j ) -> F
{ if( i < j ) { return F(i+1)/F(j+1); }
else { return F(j+1)/F(i+1); } };
IndexDependentFill( L, function<F(Int,Int)>(lehmerFill) );
}
示例9: KMS
void KMS( AbstractBlockDistMatrix<T>& K, Int n, T rho )
{
DEBUG_ONLY(CallStackEntry cse("KMS"))
K.Resize( n, n );
auto kmsFill =
[=]( Int i, Int j ) -> T
{ if( i < j ) { return Pow(rho,T(j-i)); }
else { return Conj(Pow(rho,T(i-j))); } };
IndexDependentFill( K, function<T(Int,Int)>(kmsFill) );
}
示例10: Toeplitz
void Toeplitz( AbstractDistMatrix<S>& A, Int m, Int n, const vector<T>& a )
{
EL_DEBUG_CSE
const Int length = m+n-1;
if( a.size() != Unsigned(length) )
LogicError("a was the wrong size");
A.Resize( m, n );
auto toeplitzFill = [&]( Int i, Int j ) { return a[i-j+(n-1)]; };
IndexDependentFill( A, function<S(Int,Int)>(toeplitzFill) );
}
示例11: Redheffer
void Redheffer( AbstractBlockDistMatrix<T>& R, Int n )
{
DEBUG_ONLY(CSE cse("Redheffer"))
R.Resize( n, n );
auto redhefferFill =
[]( Int i, Int j ) -> T
{ if( j == 0 || ((j+1)%(i+1))==0 ) { return T(1); }
else { return T(0); } };
IndexDependentFill( R, function<T(Int,Int)>(redhefferFill) );
}
示例12: DEBUG_ONLY
void Egorov
( Matrix<Complex<Real>>& A, function<Real(Int,Int)> phase, Int n )
{
DEBUG_ONLY(CSE cse("Egorov"))
A.Resize( n, n );
auto egorovFill =
[&]( Int i, Int j ) -> Complex<Real>
{ const Real theta = phase(i,j);
return Complex<Real>(Cos(theta),Sin(theta)); };
IndexDependentFill( A, function<Complex<Real>(Int,Int)>(egorovFill) );
}
示例13: GKS
void GKS( AbstractBlockDistMatrix<F>& A, Int n )
{
DEBUG_ONLY(CallStackEntry cse("GKS"))
A.Resize( n, n );
auto gksFill =
[]( Int i, Int j ) -> F
{ if( i < j ) { return -F(1)/Sqrt(F(j+1)); }
else if( i == j ) { return F(1)/Sqrt(F(j+1)); }
else { return F(0); } };
IndexDependentFill( A, function<F(Int,Int)>(gksFill) );
}
示例14: KMS
void KMS( AbstractDistMatrix<T>& K, Int n, T rho )
{
EL_DEBUG_CSE
K.Resize( n, n );
auto kmsFill =
[=]( Int i, Int j ) -> T
{ if( i < j ) {
return Pow(rho,T(j-i));
}
else { return Conj(Pow(rho,T(i-j))); } };
IndexDependentFill( K, function<T(Int,Int)>(kmsFill) );
}
示例15: Fourier
void Fourier( AbstractBlockDistMatrix<Complex<Real>>& A, Int n )
{
DEBUG_ONLY(CallStackEntry cse("Fourier"))
A.Resize( n, n );
const Real pi = 4*Atan( Real(1) );
const Real nSqrt = Sqrt( Real(n) );
auto fourierFill =
[=]( Int i, Int j ) -> Complex<Real>
{ const Real theta = -2*pi*i*j/n;
return Complex<Real>(Cos(theta),Sin(theta))/nSqrt; };
IndexDependentFill( A, function<Complex<Real>(Int,Int)>(fourierFill) );
}