<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, is there a member() function for Vectors ?</title>
    <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 11:14:30 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 11:14:30 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, is there a member() function for Vectors ?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, is there a member() function for Vectors ?</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-</link>
    </image>
    <item>
      <title>Lookup table</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#answer140337</link>
      <itunes:summary>&lt;p&gt;You might try creating a table that does reverse-lookup.&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;BasisIndex := table([seq(basis[i] = i, i=1..upperbound(basis,1))]):&lt;/pre&gt;
&lt;p&gt;Then, to get the index of Vector v, do BasisIndex[v]. Because v may not be in the basis, you might do&lt;/p&gt;
&lt;pre&gt;if assigned(BasisIndex[v]) then&lt;br&gt;&amp;nbsp;&amp;nbsp; indx := BasisIndex[v];&lt;br&gt;else&lt;br&gt;&amp;nbsp;&amp;nbsp; whatever is appropriate&lt;br&gt;end if;&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You might try creating a table that does reverse-lookup.&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;BasisIndex := table([seq(basis[i] = i, i=1..upperbound(basis,1))]):&lt;/pre&gt;
&lt;p&gt;Then, to get the index of Vector v, do BasisIndex[v]. Because v may not be in the basis, you might do&lt;/p&gt;
&lt;pre&gt;if assigned(BasisIndex[v]) then&lt;br&gt;&amp;nbsp;&amp;nbsp; indx := BasisIndex[v];&lt;br&gt;else&lt;br&gt;&amp;nbsp;&amp;nbsp; whatever is appropriate&lt;br&gt;end if;&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>140337</guid>
      <pubDate>Wed, 14 Nov 2012 21:29:37 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>Another way</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#answer140343</link>
      <itunes:summary>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;form name="worksheet_form"&gt;
&lt;table style="width: 576px;" align="center"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #000000; font-size: 100%; font-family: Times New Roman,serif; font-weight: normal; font-style: normal;"&gt;How about this?&lt;/span&gt;&lt;/p&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;restart;basis:=Vector(1..4):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;basis[1]:=Vector([4,0,0,0]): basis[2]:=Vector([3,2,0,0]): basis[3]:=Vector([2,0,0,2]): basis[4]:=Vector([1,1,2,0]):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;v:=Vector([2,0,0,2]):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;for j to nops(basis) do if is(LinearAlgebra:-Norm(basis[j]-v) = 0) then print(j) end if end do;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=140343/447841/70d8650b1544d48a5b179220f4d5aa32.gif" alt="3" width="13" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;(1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=140343/447841/cfcba8f66acd5b750ac176af85e70ef9.gif" alt="NULL" width="11" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;input type="hidden" name="sequence" value="1"&gt; &lt;input type="hidden" name="cmd" value="none"&gt;&lt;/form&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=140343/447841/ind.mw"&gt;Download ind.mw&lt;/a&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;form name="worksheet_form"&gt;
&lt;table style="width: 576px;" align="center"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #000000; font-size: 100%; font-family: Times New Roman,serif; font-weight: normal; font-style: normal;"&gt;How about this?&lt;/span&gt;&lt;/p&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;restart;basis:=Vector(1..4):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;basis[1]:=Vector([4,0,0,0]): basis[2]:=Vector([3,2,0,0]): basis[3]:=Vector([2,0,0,2]): basis[4]:=Vector([1,1,2,0]):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;v:=Vector([2,0,0,2]):&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="margin-left: 0px; margin-right: 0px;"&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt; &amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;span style="color: #ff0000; font-size: 100%; font-family: Courier New,monospace; font-weight: bold; font-style: normal;"&gt;for j to nops(basis) do if is(LinearAlgebra:-Norm(basis[j]-v) = 0) then print(j) end if end do;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=140343/447841/70d8650b1544d48a5b179220f4d5aa32.gif" alt="3" width="13" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;(1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=140343/447841/cfcba8f66acd5b750ac176af85e70ef9.gif" alt="NULL" width="11" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;input type="hidden" name="sequence" value="1"&gt; &lt;input type="hidden" name="cmd" value="none"&gt;&lt;/form&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=140343/447841/ind.mw"&gt;Download ind.mw&lt;/a&gt;&lt;/p&gt;</description>
      <guid>140343</guid>
      <pubDate>Wed, 14 Nov 2012 22:10:18 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>binary search</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#answer140370</link>
      <itunes:summary>&lt;p&gt;Here's the idea I suggested. It uses &lt;a href="http://www.maplesoft.com/support/help/search.aspx?term=ListTools[BinarySearch]"&gt;?ListTools[BinarySearch]&lt;/a&gt; to quickly search a list of "basis" vectors (here a random collection of Vectors). The basis is sorted using the same procedure (lessthan) used in the binary search.&lt;/p&gt;
&lt;pre&gt;lessthan := proc(v,w)&lt;br&gt;local i,n;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n := upperbound(v,1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i to n while v[i] = w[i] do end do;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i&amp;lt;=n and v[i] &amp;lt; w[i];&lt;br&gt;end proc:&lt;br&gt;&lt;br&gt;equal := proc(v,w)&lt;br&gt;local i,n;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n := upperbound(v,1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i to n while v[i] = w[i] do end do;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; evalb(i&amp;gt;n);&lt;br&gt;end proc:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;# Generate a list of 50 random vectors with dimension 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;L := [seq(rtable(1..5, random(1..10)), i=1..50)]:&lt;br&gt;# Use lessthan to sort the Vectors&lt;br&gt;B := sort(L,lessthan);&lt;br&gt;&lt;br&gt;# Choose a member from B, and find it in B&lt;br&gt;ListTools:-BinarySearch(B, B[34], lessthan, equal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Here's the idea I suggested. It uses &lt;a href="http://www.maplesoft.com/support/help/search.aspx?term=ListTools[BinarySearch]"&gt;?ListTools[BinarySearch]&lt;/a&gt; to quickly search a list of "basis" vectors (here a random collection of Vectors). The basis is sorted using the same procedure (lessthan) used in the binary search.&lt;/p&gt;
&lt;pre&gt;lessthan := proc(v,w)&lt;br&gt;local i,n;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n := upperbound(v,1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i to n while v[i] = w[i] do end do;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i&amp;lt;=n and v[i] &amp;lt; w[i];&lt;br&gt;end proc:&lt;br&gt;&lt;br&gt;equal := proc(v,w)&lt;br&gt;local i,n;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n := upperbound(v,1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i to n while v[i] = w[i] do end do;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; evalb(i&amp;gt;n);&lt;br&gt;end proc:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;# Generate a list of 50 random vectors with dimension 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;L := [seq(rtable(1..5, random(1..10)), i=1..50)]:&lt;br&gt;# Use lessthan to sort the Vectors&lt;br&gt;B := sort(L,lessthan);&lt;br&gt;&lt;br&gt;# Choose a member from B, and find it in B&lt;br&gt;ListTools:-BinarySearch(B, B[34], lessthan, equal);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&lt;/pre&gt;</description>
      <guid>140370</guid>
      <pubDate>Thu, 15 Nov 2012 06:45:23 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>Not 100% working</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#comment140344</link>
      <itunes:summary>&lt;p&gt;Thanks Joe, that was a neat solution, just what I needed. Unfortunately, it does not seem to work if I am querying the BasisIndex table with a separetly created vector which is element-wise identical to one vector in the basis structure. Like in this example:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;basis:=Vector(1..4):&lt;/p&gt;
&lt;p&gt;basis[1]:=Vector([4,0,0,0]): basis[2]:=Vector([3,2,0,0]): basis[3]:=Vector([2,0,0,2]): basis[4]:=Vector([1,1,2,0]):&lt;/p&gt;
&lt;p&gt;BasisIndex := table([seq(basis[i] = i, i=1..upperbound(basis,1))]):&lt;/p&gt;
&lt;p&gt;v:=basis[1]: v2:=Vector([4,0,0,0]):&lt;/p&gt;
&lt;p&gt;if assigned(BasisIndex[v]) then BasisIndex[v]; else print("Not assigned"): end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;br&gt;if assigned(BasisIndex[v2]) then BasisIndex[v2]; else print("Not assigned"): end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Not assigned"&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I do is(v=v2), I get a false, so I am not surprised that it is not working but, why does this happen? I have created both vectors in the same exact way so they should be identical, shouldn't they ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks Joe, that was a neat solution, just what I needed. Unfortunately, it does not seem to work if I am querying the BasisIndex table with a separetly created vector which is element-wise identical to one vector in the basis structure. Like in this example:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;basis:=Vector(1..4):&lt;/p&gt;
&lt;p&gt;basis[1]:=Vector([4,0,0,0]): basis[2]:=Vector([3,2,0,0]): basis[3]:=Vector([2,0,0,2]): basis[4]:=Vector([1,1,2,0]):&lt;/p&gt;
&lt;p&gt;BasisIndex := table([seq(basis[i] = i, i=1..upperbound(basis,1))]):&lt;/p&gt;
&lt;p&gt;v:=basis[1]: v2:=Vector([4,0,0,0]):&lt;/p&gt;
&lt;p&gt;if assigned(BasisIndex[v]) then BasisIndex[v]; else print("Not assigned"): end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;br&gt;if assigned(BasisIndex[v2]) then BasisIndex[v2]; else print("Not assigned"): end if;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Not assigned"&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I do is(v=v2), I get a false, so I am not surprised that it is not working but, why does this happen? I have created both vectors in the same exact way so they should be identical, shouldn't they ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;</description>
      <guid>140344</guid>
      <pubDate>Wed, 14 Nov 2012 22:35:47 Z</pubDate>
      <itunes:author>luigidavinci</itunes:author>
      <author>luigidavinci</author>
    </item>
    <item>
      <title>mea culpa</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#comment140349</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-#comment140344"&gt;@luigidavinci&lt;/a&gt; I feared this might be an issue and should have mentioned it originally.&amp;nbsp; Maple Vectors are mutable data structures; as such, two Maple Vectors can have identical content but have different addresses.&amp;nbsp; That is not the case for, say, lists.&amp;nbsp; As such, one cannot generally use a table to lookup a Vector, as I suggested, because the indexing is done on the address of the index, not on its content.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A method I suggested below is to sort the collection of Vectors by norm, then use that to restrict a search to a subset. That assumes the Vectors have different norms. Another possibility, probably faster, is to sort the Vectors lexicographically, using the slots of the Vectors.&amp;nbsp; &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-#comment140344"&gt;@luigidavinci&lt;/a&gt; I feared this might be an issue and should have mentioned it originally.&amp;nbsp; Maple Vectors are mutable data structures; as such, two Maple Vectors can have identical content but have different addresses.&amp;nbsp; That is not the case for, say, lists.&amp;nbsp; As such, one cannot generally use a table to lookup a Vector, as I suggested, because the indexing is done on the address of the index, not on its content.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A method I suggested below is to sort the collection of Vectors by norm, then use that to restrict a search to a subset. That assumes the Vectors have different norms. Another possibility, probably faster, is to sort the Vectors lexicographically, using the slots of the Vectors.&amp;nbsp; &lt;/p&gt;</description>
      <guid>140349</guid>
      <pubDate>Wed, 14 Nov 2012 23:34:09 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>Difference</title>
      <link>http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-?ref=Feed:MaplePrimes:is there a member() function for Vectors ?:Comments#comment140352</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-#comment140349"&gt;@Joe Riel&lt;/a&gt; As far as I understand it, the usage of the LinearAlgebra:-Norm command for indexing does not require all norms to be different.&lt;/p&gt;
&lt;p&gt;PS.&lt;/p&gt;
&lt;p&gt;&amp;gt; sort(basis, lexorder);&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;Error, invalid input: a string/name Vector is expected for sort method `lexorder`&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/140311-Is-There-A-Member-Function-For-Vectors-#comment140349"&gt;@Joe Riel&lt;/a&gt; As far as I understand it, the usage of the LinearAlgebra:-Norm command for indexing does not require all norms to be different.&lt;/p&gt;
&lt;p&gt;PS.&lt;/p&gt;
&lt;p&gt;&amp;gt; sort(basis, lexorder);&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;Error, invalid input: a string/name Vector is expected for sort method `lexorder`&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>140352</guid>
      <pubDate>Thu, 15 Nov 2012 00:10:12 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
  </channel>
</rss>