当前位置: 首页>>代码示例>>C++>>正文


C++ IndexDependentFill函数代码示例

本文整理汇总了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) );
}
开发者ID:nooperpudd,项目名称:Elemental,代码行数:7,代码来源:GCDMatrix.cpp

示例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) );
}
开发者ID:bluehope,项目名称:Elemental,代码行数:7,代码来源:MinIJ.cpp

示例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) );
}
开发者ID:AmiArnab,项目名称:Elemental,代码行数:7,代码来源:Hilbert.cpp

示例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) );
}
开发者ID:sg0,项目名称:Elemental,代码行数:8,代码来源:Parter.cpp

示例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) );
}
开发者ID:sg0,项目名称:Elemental,代码行数:8,代码来源:Ris.cpp

示例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) );
}
开发者ID:YingzhouLi,项目名称:Elemental,代码行数:8,代码来源:Ris.cpp

示例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) );
}
开发者ID:elemental,项目名称:Elemental,代码行数:8,代码来源:Parter.cpp

示例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) );
}
开发者ID:AmiArnab,项目名称:Elemental,代码行数:10,代码来源:Lehmer.cpp

示例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) );
}
开发者ID:jakebolewski,项目名称:Elemental,代码行数:10,代码来源:KMS.cpp

示例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) );
}
开发者ID:elemental,项目名称:Elemental,代码行数:10,代码来源:Toeplitz.cpp

示例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) );
}
开发者ID:birm,项目名称:Elemental,代码行数:10,代码来源:Redheffer.cpp

示例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) );
}
开发者ID:restrin,项目名称:Elemental,代码行数:11,代码来源:Egorov.cpp

示例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) );
}
开发者ID:jakebolewski,项目名称:Elemental,代码行数:11,代码来源:GKS.cpp

示例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) );
}
开发者ID:elemental,项目名称:Elemental,代码行数:12,代码来源:KMS.cpp

示例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) );
}
开发者ID:sg0,项目名称:Elemental,代码行数:12,代码来源:Fourier.cpp


注:本文中的IndexDependentFill函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。