<html><head></head><body><div class="ydp2a8bd4b5yahoo-style-wrap" style="font-family:verdana, helvetica, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Hi everybody,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I am using Vector API to manipulate arrays for linear algebra purposes with stride arrays. I was considering to use directly MemorySegment but I found some APIs that does not exist for MemorySegment, but there are for arrays. Those methods are for loading and storing from a MemorySegment using an index map. This is really useful for stride arrays. Below is an example of code:</div><div dir="ltr" data-setdir="false"><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve;"><br></span></div><div dir="ltr" data-setdir="false"><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve;">VectorSpecies</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(8, 8, 8);"><</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve;">Double</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(8, 8, 8);">> </span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve;">vsd </span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(8, 8, 8);">= </span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve;">DoubleVector</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(8, 8, 8);">.</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(135, 16, 148); font-style: italic;">SPECIES_PREFERRED</span><span style="font-family: JetBrains Mono, monospace; font-size: 10.5pt; white-space-collapse: preserve; color: rgb(8, 8, 8);">;</span><br></div><div dir="ltr" data-setdir="false"><div><div style="color: rgb(8, 8, 8);"><pre style="font-family:'JetBrains Mono',monospace;font-size:10.5pt;"><span style="color:#0033b3;">int</span>[] <span style="color:#000000;">indexes </span>= <span style="color:#0033b3;">new int</span>[<span style="color:#000000;">vsd</span>.length()];<br><span style="color:#0033b3;">for </span>(<span style="color:#0033b3;">int </span><span style="color:#000000;">i </span>= <span style="color:#1750eb;">0</span>; <span style="color:#000000;">i </span>< <span style="color:#000000;">indexes</span>.<span style="color:#871094;">length</span>; <span style="color:#000000;">i</span>++) {<br> <span style="color:#000000;">indexes</span>[<span style="color:#000000;">i</span>] = <span style="color:#000000;">i </span>* <span style="color:#1750eb;">2</span>;<br>}<br><br><span style="color:#0033b3;">double</span>[] <span style="color:#000000;">array </span>= <span style="color:#0033b3;">new double</span>[<span style="color:#1750eb;">1000</span>];<br><span style="color:#8c8c8c;font-style:italic;">// read with index map elements 2 by 2<br></span><span style="color:#000000;">DoubleVector</span>.<span style="font-style:italic;">fromArray</span>(<span style="color:#000000;">vsd</span>, <span style="color:#000000;">array</span>, <span style="color:#1750eb;">0</span>, <span style="color:#000000;">indexes</span>, <span style="color:#1750eb;">0</span>);<br><br><span style="color:#000000;">MemorySegment ms </span>= <span style="color:#000000;">MemorySegment</span>.<span style="font-style:italic;">ofArray</span>(<span style="color:#000000;">array</span>);<br><span style="color:#8c8c8c;font-style:italic;">// no possible to read with index map<br></span><span style="color:#000000;">vsd</span>.fromMemorySegment(<span style="color:#000000;">ms</span>, <span style="color:#1750eb;">0</span>, <span style="color:#000000;">ByteOrder</span>.<span style="font-style:italic;">nativeOrder</span>());<br></pre></div></div><br></div><div dir="ltr" data-setdir="false"><span><span style="color: rgb(0, 0, 0); font-family: verdana, helvetica, sans-serif;">Do you have in plan to implement those methods?</span></span><br></div><div dir="ltr" data-setdir="false"><span><span style="color: rgb(0, 0, 0); font-family: verdana, helvetica, sans-serif;"><br></span></span></div><div dir="ltr" data-setdir="false"><span><span style="color: rgb(0, 0, 0); font-family: verdana, helvetica, sans-serif;">Thanks for everything. Best regards,</span></span></div><div dir="ltr" data-setdir="false"><span><span style="color: rgb(0, 0, 0); font-family: verdana, helvetica, sans-serif;">Aurelian Tutuianu</span></span></div></div></body></html>