Example #1
0
void CheckInputNN( const Matrix<T>& A, const Matrix<T>& B, const Matrix<T>& C )
{
    if( A.Height() != C.Height() || B.Width()  != C.Width() ||
        A.Width()  != B.Height() || A.Height() != B.Width() )
        LogicError
        ("Nonconformal LocalTrrk:\n",
         DimsString(A,"A"),"\n",DimsString(B,"B"),"\n",DimsString(C,"C"));
}
Example #2
0
void CheckInputTN
( Orientation orientationOfA,
  const Matrix<T>& A, const Matrix<T>& B, const Matrix<T>& C )
{
    if( orientationOfA == NORMAL )
        LogicError("A must be (Conjugate)Transpose'd");
    if( A.Width() != C.Height() || B.Width() != C.Width() ||
        A.Height() != B.Height() || A.Width() != B.Width() )
        LogicError
        ("Nonconformal LocalTrrk:\n",
         DimsString(A,"A"),"\n",DimsString(B,"B"),"\n",DimsString(C,"C"));
}
Example #3
0
#ifndef EL_FACTOR_LDL_NUMERIC_LOWERMULTIPLY_FRONTBACKWARD_HPP
#define EL_FACTOR_LDL_NUMERIC_LOWERMULTIPLY_FRONTBACKWARD_HPP

namespace El {
namespace ldl {

template<typename F>
void FrontVanillaLowerBackwardMultiply
( const Matrix<F>& L, Matrix<F>& X, bool conjugate )
{
    EL_DEBUG_CSE
    EL_DEBUG_ONLY(
        if( L.Height() < L.Width() || L.Height() != X.Height() )
        LogicError
        ("Nonconformal multiply:\n",
         DimsString(L,"L"),"\n",DimsString(X,"X"));
    )
        Matrix<F> LT, LB, XT, XB;
    LockedPartitionDown( L, LT, LB, L.Width() );
    PartitionDown( X, XT, XB, L.Width() );

    const Orientation orientation = ( conjugate ? ADJOINT : TRANSPOSE );
    Trmm( LEFT, LOWER, orientation, UNIT, F(1), LT, XT );
    Gemm( orientation, NORMAL, F(1), LB, XB, F(1), XT );
}

template<typename F>
void FrontLowerBackwardMultiply
( const Front<F>& front, Matrix<F>& W, bool conjugate )
{
    EL_DEBUG_CSE
Example #4
0
namespace El {

template<typename T>
void Gemv
( Orientation orientation,
  T alpha, const Matrix<T>& A,
           const Matrix<T>& x,
  T beta,        Matrix<T>& y )
{
    EL_DEBUG_CSE
    EL_DEBUG_ONLY(
      if( ( x.Height() != 1 && x.Width() != 1 ) ||
          ( y.Height() != 1 && y.Width() != 1 ) )
          LogicError
          ("Nonconformal: \n",DimsString(x,"x"),"\n",DimsString(y,"y"));
      const Int xLength = ( x.Width()==1 ? x.Height() : x.Width() );
      const Int yLength = ( y.Width()==1 ? y.Height() : y.Width() );
      if( orientation == NORMAL )
      {
          if( A.Height() != yLength || A.Width() != xLength )
              LogicError
              ("Nonconformal: \n",DimsString(A,"A"),"\n",
               DimsString(x,"x"),"\n",DimsString(y,"y"));
      }
      else
      {
          if( A.Width() != yLength || A.Height() != xLength )
              LogicError
              ("Nonconformal: \n",DimsString(A,"A"),"\n",
               DimsString(x,"x"),"\n",DimsString(y,"y"));