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


C++ Teuchos::ptr方法代码示例

本文整理汇总了C++中Teuchos::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Teuchos::ptr方法的具体用法?C++ Teuchos::ptr怎么用?C++ Teuchos::ptr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Teuchos的用法示例。


在下文中一共展示了Teuchos::ptr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: uninitializePrec

THYRA_DEPRECATED
void uninitializePrec(
  const PreconditionerFactoryBase<Scalar> &precFactory,
  PreconditionerBase<Scalar> *prec,
  Teuchos::RCP<const LinearOpBase<Scalar> > *fwdOp = NULL,
  ESupportSolveUse *supportSolveUse = NULL
  )
{
  using Teuchos::ptr;
  uninitializePrec<Scalar>(precFactory, ptr(prec), ptr(fwdOp),
    ptr(supportSolveUse));
}
开发者ID:haripandey,项目名称:trilinos,代码行数:12,代码来源:Thyra_PreconditionerFactoryHelpers.hpp

示例2: solve

THYRA_DEPRECATED
SolveStatus<Scalar> solve(
  const LinearOpWithSolveBase<Scalar> &A,
  const EOpTransp A_trans,
  const MultiVectorBase<Scalar> &B,
  MultiVectorBase<Scalar> *X,
  const SolveCriteria<Scalar> *solveCriteria = NULL
  )
{
  using Teuchos::ptr;
  return A.solve(A_trans, B, ptr(X), ptr(solveCriteria));
}
开发者ID:haripandey,项目名称:trilinos,代码行数:12,代码来源:Thyra_LinearOpWithSolveBase_decl.hpp

示例3: uninitializeOp

THYRA_DEPRECATED
void uninitializeOp(
  const LinearOpWithSolveFactoryBase<Scalar> &lowsFactory,
  LinearOpWithSolveBase<Scalar> *Op,
  RCP<const LinearOpBase<Scalar> > *fwdOp = NULL,
  RCP<const PreconditionerBase<Scalar> > *prec = NULL,
  RCP<const LinearOpBase<Scalar> > *approxFwdOp = NULL,
  ESupportSolveUse *supportSolveUse = NULL
  )
{
  using Teuchos::ptr;
  uninitializeOp<Scalar>(lowsFactory, ptr(Op), ptr(fwdOp), ptr(prec),
    ptr(approxFwdOp), ptr(supportSolveUse));
}
开发者ID:haripandey,项目名称:trilinos,代码行数:14,代码来源:Thyra_LinearOpWithSolveFactoryHelpers.hpp

示例4: main

int 
main (int argc, char *argv[]) 
{
  using Teuchos::Array;
  using Teuchos::as;
  using Teuchos::Comm;
  using Teuchos::CommandLineProcessor;
  using Teuchos::ParameterList;
  using Teuchos::ptr;
  using Teuchos::RCP;
  using Teuchos::rcp;
  using Teuchos::REDUCE_MAX;
  using Teuchos::REDUCE_MIN;
  using Teuchos::reduceAll;
  using std::cerr;
  using std::cout;
  using std::endl;

  typedef double scalar_type;
  typedef int local_ordinal_type;
  typedef int global_ordinal_type;
  typedef Kokkos::SerialNode node_type;

  Teuchos::GlobalMPISession mpiSession (&argc, &argv, &cout);
  RCP<const Comm<int> > comm = 
    Tpetra::DefaultPlatform::getDefaultPlatform().getComm();
  const int myRank = comm->getRank();
  const int numProcs = comm->getSize();

  std::string inputFilename;  // Matrix Market file to read
  std::string temporaryFilename; // Matrix Market file to write (if applicable)
  std::string outputFilename; // Matrix Market file to write (if applicable)

  // Number of a specific test to run.  If nonzero, only run that
  // test.  We always run Test #1 since its result is needed for
  // subsequent tests.
  int testToRun = 0;

  // FIXME (mfh 07 Feb 2012) Currently, all tests with a different
  // index base FAIL.  Reading in the multivector appears to be
  // correct, but writing it results in a multivector of all zeros (on
  // _all_ processes).
  bool testDifferentIndexBase = false;
  bool testContiguousInputMap = true;
  bool testNoncontiguousInputMap = false; 

  bool testWrite = true; // Test Matrix Market output?
  bool tolerant = false; // Parse the file tolerantly?
  bool echo = false;     // Echo the read-in matrix back?
  bool verbose = false;  // Verbosity of output
  bool debug = false;    // Print debugging info?
  // If true, stop after a single test failure.  Intended for
  // interactive use, so that you can examine a test's output file.
  // Not intended for batch or ctest use.
  bool stopAfterFailure = false; 

  CommandLineProcessor cmdp (false, true);
  cmdp.setOption ("inputFilename", &inputFilename,
		  "Name of the Matrix Market dense matrix file to read.");
  cmdp.setOption ("temporaryFilename", &temporaryFilename,
		  "If --testWrite is true, then use this file as temporary "
		  "storage on (MPI) Proc 0.  Otherwise, this argument is "
		  "ignored.");
  cmdp.setOption ("outputFilename", &outputFilename,
		  "If --testWrite is true, then write the read-in matrix to "
		  "this file in Matrix Market format on (MPI) Proc 0.  "
		  "Otherwise, this argument is ignored.  Note that the output "
		  "file may not be identical to the input file.");
  cmdp.setOption ("testToRun", &testToRun, "Number of a specific test to run.  "
		  "If nonzero, only run that test.  We always run Test #1 since"
		  " its result is needed for subsequent tests.");
  cmdp.setOption ("testDifferentIndexBase", "dontTestDifferentIndexBase",
		  &testDifferentIndexBase, "Whether to test input and output "
		  "for Maps with different index bases.");
  cmdp.setOption ("testContiguousInputMap", "dontTestContiguousInputMap",
		  &testContiguousInputMap,
		  "Whether to test input and output for nonnull contiguous "
		  "input Maps.");
  cmdp.setOption ("testNoncontiguousInputMap", "dontTestNoncontiguousInputMap",
		  &testNoncontiguousInputMap,
		  "Whether to test input and output for nonnull noncontiguous "
		  "input Maps.");
  cmdp.setOption ("testWrite", "noTestWrite", &testWrite,
		  "Whether to test Matrix Market file output.  Ignored if no "
		  "--outputFilename value is given.");
  cmdp.setOption ("tolerant", "strict", &tolerant, 
		  "Whether to parse the input Matrix Market file tolerantly.");
  cmdp.setOption ("echo", "noecho", &echo,
		  "Whether to echo the read-in matrix back to stdout on Rank 0 "
		  "in Matrix Market format.  Note that the echoed matrix may "
		  "not be identical to the input file.");
  cmdp.setOption ("verbose", "quiet", &verbose, "Print messages and results.");
  cmdp.setOption ("debug", "nodebug", &debug, "Print debugging information.");
  cmdp.setOption ("stopAfterFailure", "dontStopAfterFailure", &stopAfterFailure, 
		  "Whether to stop after a single test failure.");

  // Parse the command-line arguments.
  {
    const CommandLineProcessor::EParseCommandLineReturn parseResult = 
      cmdp.parse (argc,argv);
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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