没有宏,没有循环,纯C ++ [英] No Macros, No for loops, Pure C++

查看:58
本文介绍了没有宏,没有循环,纯C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它在一个9维空间爆炸,但我很确定这是由于尺寸_t的

尺寸。


---开始:DataGeneration_Test ---

Tensor< T 3,3>

1,2,3,4,5,6,7,8,9, 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27

TensorIndices< 3,3>

:: ORDER:3

:: RANK:3

:: SIZE:27

:: _ gslices:

GSlices< 3,3> :: _切片:

开始:0尺寸:1,3,3步幅:9,3,1

开始:9种尺寸:1,3,3步幅:9,3,1

开始:18种尺寸:1,3,3步幅:9,3,1

GSlices :: _ subslices:

GSlices< 3,2> :: _切片:

start:0尺寸:1,3步幅:3,1

开始:3种尺寸:1,3步幅:3,1

开始:6种尺寸:1,3步幅:3,1

GSlices :: _ subslices:

GSlices< 3,1> :: _切片:

开始:0尺寸:1,1,1步幅:1,1,1

开始:1个尺寸:1,1,1步幅:1,1,1

开始:2个尺码: 1,1,1步幅:1,1,1


GSlices< 3,1> :: _切片:

start:3尺寸:1,1 ,1步:1,1,1

开始:4种尺寸:1,1,1步幅:1,1,1

开始:5种尺寸:1,1 ,1步:1,1,1


GSlices< 3,1> :: _切片:

start:6尺寸:1,1,1步幅:1,1,1

开始:7种尺寸:1,1,1步幅:1,1,1

开始:8种尺寸:1,1,1步幅:1,1,1

GSlices< 3,2> :: _切片:

start:9尺寸:1,3步幅:3,1

开始:12种尺寸:1,3步幅:3,1

开始:15种尺寸:1,3步幅:3,1

GSlices :: _ subslices:

GSlices< 3,1> :: _切片:

start:9尺寸:1,1,1步幅:1,1,1

开始:10种尺寸:1,1,1步幅:1,1,1

开始:11种尺寸:1,1,1步幅:1,1,1

GSlices< 3,1> :: _切片:

start:12尺寸:1,1,1步幅:1,1,1

start: 13种尺寸:1,1,1步幅:1,1,1

开始:14种尺寸:1,1,1步幅:1,1,1

GSlices< 3,1> :: _切片:

start:15尺寸:1,1,1步幅:1,1,1

start: 16种尺寸:1,1,1步幅:1,1,1

开始:17种尺寸:1,1,1步幅:1,1,1

GSlices< 3,2> :: _切片:

开始:18种尺寸:1,3步幅:3,1

开始:21种尺寸:1,3步幅:3,1

开始:24种尺寸:1,3步幅:3,1

GSlices :: _ subslices:

GSlices< 3,1> :: _slices:

开始:18种尺寸:1,1,1步幅:1,1,1

开始:19种尺寸:1,1,1步幅:1,1 ,1

开始:20种尺寸:1,1,1步幅:1,1,1


GSlices< 3,1> :: _切片:

开始:21种尺寸:1,1,1步幅:1,1,1

开始:22种尺寸:1,1,1步幅:1,1,1

开始:23种尺寸:1,1,1步幅:1,1,1


GSlices< 3,1> :: _切片:

开始:24种尺寸:1,1,1步幅:1,1,1

开始:25种尺寸:1,1,1步幅:1,1,1

开始:26种尺寸:1,1,1步幅:1,1,1


---结束:D ataGeneration_Test ---


-

如果我们的假设是关于任何事情而不是关于某一个或多个

特别是事情,然后我们的推论构成数学。因此,数学可能被定义为我们永远不知道我们所讨论的是什么,以及我们所说的是否属实的主题。 - Bertrand

Russell

It blows up on a 9 dimensional space, but I''m pretty sure that''s due to the
size of size_t.

--- begin: DataGeneration_Test ---
Tensor<T 3, 3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27
TensorIndices<3, 3>
::ORDER : 3
::RANK : 3
::SIZE : 27
::_gslices:
GSlices<3,3>::_slices:
start: 0 sizes: 1,3,3 strides: 9,3,1
start: 9 sizes: 1,3,3 strides: 9,3,1
start: 18 sizes: 1,3,3 strides: 9,3,1
GSlices::_subslices:
GSlices<3,2>::_slices:
start: 0 sizes: 1,3 strides: 3,1
start: 3 sizes: 1,3 strides: 3,1
start: 6 sizes: 1,3 strides: 3,1
GSlices::_subslices:
GSlices<3,1>::_slices:
start: 0 sizes: 1,1,1 strides: 1,1,1
start: 1 sizes: 1,1,1 strides: 1,1,1
start: 2 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 3 sizes: 1,1,1 strides: 1,1,1
start: 4 sizes: 1,1,1 strides: 1,1,1
start: 5 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 6 sizes: 1,1,1 strides: 1,1,1
start: 7 sizes: 1,1,1 strides: 1,1,1
start: 8 sizes: 1,1,1 strides: 1,1,1
GSlices<3,2>::_slices:
start: 9 sizes: 1,3 strides: 3,1
start: 12 sizes: 1,3 strides: 3,1
start: 15 sizes: 1,3 strides: 3,1
GSlices::_subslices:
GSlices<3,1>::_slices:
start: 9 sizes: 1,1,1 strides: 1,1,1
start: 10 sizes: 1,1,1 strides: 1,1,1
start: 11 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 12 sizes: 1,1,1 strides: 1,1,1
start: 13 sizes: 1,1,1 strides: 1,1,1
start: 14 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 15 sizes: 1,1,1 strides: 1,1,1
start: 16 sizes: 1,1,1 strides: 1,1,1
start: 17 sizes: 1,1,1 strides: 1,1,1
GSlices<3,2>::_slices:
start: 18 sizes: 1,3 strides: 3,1
start: 21 sizes: 1,3 strides: 3,1
start: 24 sizes: 1,3 strides: 3,1
GSlices::_subslices:
GSlices<3,1>::_slices:
start: 18 sizes: 1,1,1 strides: 1,1,1
start: 19 sizes: 1,1,1 strides: 1,1,1
start: 20 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 21 sizes: 1,1,1 strides: 1,1,1
start: 22 sizes: 1,1,1 strides: 1,1,1
start: 23 sizes: 1,1,1 strides: 1,1,1

GSlices<3,1>::_slices:
start: 24 sizes: 1,1,1 strides: 1,1,1
start: 25 sizes: 1,1,1 strides: 1,1,1
start: 26 sizes: 1,1,1 strides: 1,1,1


--- end: DataGeneration_Test ---

--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell

推荐答案



" Steven T. Hatton" ; <苏****** @ setidava.kushan.aa>在消息中写道

新闻:cc ******************** @ speakeasy.net ...

"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message
news:cc********************@speakeasy.net...
它在9维空间爆炸,但我很确定这是因为
size_t的大小。

---开始:DataGeneration_Test - -
Tensor< T 3,3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, 18,19,20,21,22,23,24,25,26,27
TensorIndices< 3,3>
It blows up on a 9 dimensional space, but I''m pretty sure that''s due to
the
size of size_t.

--- begin: DataGeneration_Test ---
Tensor<T 3, 3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27
TensorIndices<3, 3>




< snip>

关心你在这里谈论的确切内容? :-)


-Howard



<snip>
Care to enlighten us as to exactly what you''re talking about here? :-)

-Howard


Howard写道:
Howard wrote:
Tensor< T 3,3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, 18,19,20,21,22,23,24,25,26,27
TensorIndices< 3,3>
Tensor<T 3, 3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27
TensorIndices<3, 3>


关心你究竟在说什么关于这里? : - )

Care to enlighten us as to exactly what you''re talking about here? :-)




循环展开表达式metatemplates,没有for循环。


编译器将输出一个巨大的砖块坚固的操作码。

电子一端进入,结果出现另一端,内部没有移动的

部件。


-

Phlip
http ://industrialxp.org/community/bi...UserInterfaces


" Phlip" < pH值******* @ yahoo.com>写道:
"Phlip" <ph*******@yahoo.com> wrote:
Howard写道:
Howard wrote:
Tensor< T 3,3>
1,2,3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 > TensorIndices< 3,3>
Tensor<T 3, 3>
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ,21,22,23,24,25,26,27
TensorIndices<3, 3>


关心你在这里谈论的确切内容? : - )
Care to enlighten us as to exactly what you''re talking about here? :-)



循环展开表达式metatemplates,没有for循环。

编译器将输出一大堆固体操作码。



Loop unrolling with expression metatemplates, without for loops.

The compiler will output essentially a huge brick of solid opcodes.




它对我来说输出不多:

i.cc:2:错误:预期的构造函数,析构函数或类型转换

之前''<''令牌

i.cc:2:错误:预期`,''或';''之前''<''令牌


是否有某些可编辑的代码?



It doesn''t output much for me:
i.cc:2: error: expected constructor, destructor, or type conversion
before ''<'' token
i.cc:2: error: expected `,'' or `;'' before ''<'' token

Is there meant to be some compilable code somewhere?


这篇关于没有宏,没有循环,纯C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆