-
-
December 29, 2024 at 12:39 pmfdtsaidSubscriberSome predefined operator can be used as input operator of iterator. Such as the following exampleÂÂfunction test(a,b: int8 ^ 3) returns (c: int8 ^ 3)c = (map $+$ << 3 >>) (a, b);ÂBut I am trying to figure out how to use
$@$
as input operator correctly. In the following program:Â ÂÂfunction mapOp(arr1,arr2: int8 ^ 2 ^ 3) returns (oarr: int8 ^ 4 ^ 3)letoarr = (map $@$ <<3>>) (arr1,arr2);telÂThe intention of the above program is to concatenate each element of typeint8^2
in arr1 and arr2 to value of typeint8^4
. But I got the following error:Prefix operator $@$ expects 2 size parameters but is here used with 0ÂHow to use$@$
as input operator of iterator in a correct way? -
January 3, 2025 at 1:38 pmBenjamin DescorpsAnsys Employee
Hello,
It is not possible to use directly the concatenation operator through an iterator. But you can through an intermediate operator. Here is the piece of code that should match your need:
function mapOp(arr1,arr2: int8 ^ 2 ^ 3) returns (oarr: int8 ^ 4 ^ 3)Â Â Â oarr = (map Op <<3>>)(arr1, arr2);Âfunction #pragma kcg expand #end Op(i1, i2 : int8 ^2) returns (o : int8 ^4)Â Â Â o = i1 @ i2;ÂHope this helps,ÂBenjamin -
January 3, 2025 at 2:04 pmfdtsaidSubscriber
The solution is very inspired, thank you!
-
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Ansys Innovation Space
Trending discussions
Top Contributors
-
1311
-
591
-
569
-
525
-
366
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.