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


C++ Piecewise::secondDerivative方法代码示例

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


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

示例1: main

int main()
{
  cout << "Testing MathTL::(Cardinal)Spline ..." << endl;






  cout << "* some point values of phi_{j,k}, d=2, j=1, k=0:" << endl;
  for (double x = -1.5; x <= 2.5; x+=0.2) {
    cout << "  phi(" << x << ")="
	 <<  EvaluateCardinalBSpline_td(2, 0, 1.5, x) << endl;
  } 



  cout << "* some point values of phi_{j,k}, d=2, j=1, k=0: with expand as picewise" << endl;
  for (double x = -1.5; x <= 2.5; x+=0.2) {
    Piecewise<double> p;
    p = ExpandBspline<3>(1, -1);
    cout << "  phi(" << x << ")="
	 <<  p(x) << endl;
  } 



  cout << "* some point values of Schoenberg Primal [P] function phi_{j,k}(x) = 2^{j/2}N_{k-d/2,d}(2^jx):" << endl;
  for (double x = -0.6; x <= 1.6; x+=0.2){
    cout << "  N_{-1,2}'(" << x << ")="
	 <<  EvaluateSchoenbergBSpline_td_xx<2>(2, 5,x) << endl;
  }


cout << "* some point values of Schoenberg Primal [P] function phi_{j,k}(x) = 2^{j/2}N_{k-d/2,d}(2^jx) with expand as picewise:" << endl;
  for (double x = -0.6; x <= 1.6; x+=0.2) {
    Piecewise<double> p;
    p = ExpandSchoenbergBspline<2>(2, 5,0);
    cout << "  N(" << x << ")="
	 <<  p.secondDerivative(x) << endl;
  }

#if 0
  cout << "* some point values of Schoenberg Primal [P] function phi_{j,k}(x) = 2^{j/2}N_{k-d/2,d}(2^jx):" << endl;
    cout <<  EvaluateSchoenbergBSpline_td<4>(0, -1, 0.0000) << endl;
    cout <<  EvaluateSchoenbergBSpline_td_x<4>(0, -1, 0.0000) << endl;
    cout <<  EvaluateSchoenbergBSpline_td_xx<4>(0, -1, 0.0000) << endl;
    double j,a,b,c,d;    
    j = (EvaluateSchoenbergBSpline_td_xx<4>(0, -1, 0.00002) - EvaluateSchoenbergBSpline_td_xx<4>(0, -1, 0.00001))/(0.00001);
    cout <<  j << endl;
	a= 1<<5;
	cout << "a=" << a  << endl;	
  



  //double EvaluateSchoenbergBSpline_td(const int j, const int k, const double x)
  Array1D<double> values1(80);
  for (double x = -1.0; x <= 3; x+=0.05) {
	values1[(int)floor((x+1.0)*20)] = EvaluateSchoenbergBSpline_td<2>(0, 1, x);
  }
    std::ofstream fs1("Schoenberg1(0,0.5).m");
    SampledMapping<1> sm1(Grid<1>(-1.0, 3.0, 80), values1);
    sm1.matlab_output(fs1);
    fs1.close();


  //EvaluateCardinalBSpline_td(const int j, const int k, const double x)
  Array1D<double> values2(80);
  for (double x = -1.0; x <= 3; x+=0.05) {
	values2[(int)floor((x+1.0)*20)] = EvaluateCardinalBSpline_td<2>(0, 1, x);
  }
    std::ofstream fs2("Cardinal1(0,0.5).m");
    SampledMapping<1> sm2(Grid<1>(-1.0, 3.0, 80), values2);
    sm2.matlab_output(fs2);
    fs2.close();

#endif


}
开发者ID:kedingagnumerikunimarburg,项目名称:Marburg_Software_Library,代码行数:81,代码来源:test_cardinalsplines.cpp


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