<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The examples that use a in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969895#M96875</link>
    <description>&lt;P&gt;The examples that use a derived type to encapsulate the vector (particularly sgeard's in #25) offer expressive potential well beyond that available using an intrinsic array.&lt;/P&gt;

&lt;P&gt;If you'll never need that potential, then - yes - there's little point using that style.&amp;nbsp; But that kind of misses the point.&lt;/P&gt;

&lt;P&gt;For a simple example - consider what the code looks like if you have some vectors of vectors and you want to do some operations on them.&amp;nbsp; Consider if you want to customize the formatted output in some way.&amp;nbsp; Consider if you want to insert some validation or error checking code into the operations themselves.&amp;nbsp; Consider if the vector is really the internal implementation of some higher level concept as intimated in #28.&amp;nbsp; Etc.&lt;/P&gt;

&lt;P&gt;I accept that inappropriate definition of the existing operators could create confusion.&amp;nbsp; But I could also write a procedure called Add that doesn't do what it says on the label, and merrily confuse all future readers of my code.&amp;nbsp; (In fact, the results of recent debugging indicate that is more or less what I have [inadvertently] done.)&lt;/P&gt;

&lt;P&gt;I also accept with current compiler capability you may not get the fastest code.&amp;nbsp; But compiler capability is also constantly improving, and the ability to transform these higher level coding structures into efficient machine code is something that I regard as an important feature.&lt;/P&gt;

&lt;P&gt;(On that topic - when the otherwise private procedures are accessed via bindings is the compiler able to see the "leaf" nature of the procedures and avoid the overhead associated with the use of a descriptor for the polymorphic argument?&amp;nbsp; If not, is that capability being considered?)&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2014 01:13:33 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2014-01-30T01:13:33Z</dc:date>
    <item>
      <title>Q about extended use of operators</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969864#M96844</link>
      <description>&lt;P&gt;I was told that the standard math operators can be extended to include user defined&lt;/P&gt;

&lt;P&gt;variables, such as what one would set up with a TYPE statement.&lt;/P&gt;

&lt;P&gt;How does one tell the compiler what to do in those instances?&lt;/P&gt;

&lt;P&gt;For instance, I want to use the * to refer to a DOT product of two vectors.&lt;/P&gt;

&lt;P&gt;Like :&lt;/P&gt;

&lt;P&gt;--------------------------------------------&lt;/P&gt;

&lt;P&gt;type(vector)A,B,C&lt;/P&gt;

&lt;P&gt;C= A*B&lt;/P&gt;

&lt;P&gt;! &amp;nbsp;where A,B, and C are defined as follows:&lt;/P&gt;

&lt;P&gt;type (vector)&lt;/P&gt;

&lt;P&gt;integer nx&lt;/P&gt;

&lt;P&gt;real(4) x(100)&lt;/P&gt;

&lt;P&gt;end type&lt;/P&gt;

&lt;P&gt;------------------------------------------&lt;/P&gt;

&lt;P&gt;Likewise I would like the + and - operators to take the &lt;STRONG&gt;sum and difference&lt;/STRONG&gt; of two vectors.&lt;/P&gt;

&lt;P&gt;Or even one could do comparisons of absolute values:&lt;/P&gt;

&lt;P&gt;if( A &amp;gt; B) go to 99&lt;/P&gt;

&lt;P&gt;I was looking for an article about this topic, but I don't know what "lingo" is used to discuss this.&lt;/P&gt;

&lt;P&gt;So I couldn't find it. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2014 16:05:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969864#M96844</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2014-01-26T16:05:41Z</dc:date>
    </item>
    <item>
      <title>Actually, I made a mistake:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969865#M96845</link>
      <description>&lt;P&gt;Actually, I made a mistake:&lt;/P&gt;

&lt;P&gt;C would be a regular scalar, not a vector,&lt;/P&gt;

&lt;P&gt;unless one is referring to a CROSS product.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So &lt;STRONG&gt;S = A * B &lt;/STRONG&gt;for example.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;But maybe there is a way to tell the compiler to redefine another operator (ex: ** )&lt;/P&gt;

&lt;P&gt;mean CROSS products? Or tell it what to do if one multiplies a scalar by a Vector?&lt;/P&gt;

&lt;P&gt;Example: &amp;nbsp;&lt;STRONG&gt;B = S* A&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;where A and B are typed &lt;STRONG&gt;vectors,&lt;/STRONG&gt; and S is an ordinary real(4) scaler variable.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2014 16:27:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969865#M96845</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2014-01-26T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Studying the many on-line</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969866#M96846</link>
      <description>&lt;P&gt;Studying the many on-line references on Fortran operator overloading would keep you busy for a while. &amp;nbsp;As you said, the suggestions are to use * for a cross product rather than a dot product, which already has a standard intrinsic.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2014 20:51:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969866#M96846</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-01-26T20:51:51Z</dc:date>
    </item>
    <item>
      <title>I realise this is an example</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969867#M96847</link>
      <description>&lt;P&gt;I realise this is an example but in the case of vector operations I really would not recommend using a derived type. The simple 1D array works just fine.&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;Real(4) :: a(3), b(3), c(3)&lt;/P&gt;

&lt;P&gt;Real(4) :: &amp;nbsp;magnitude, dot&lt;/P&gt;

&lt;P&gt;a=b-c&lt;/P&gt;

&lt;P&gt;a=b+c&lt;/P&gt;

&lt;P&gt;magnitude= norm2(a)&lt;/P&gt;

&lt;P&gt;a=a/magnitude&lt;/P&gt;

&lt;P&gt;dot=dot_product(a,b)[/fortran]&lt;/P&gt;

&lt;P&gt;All of the above are quick, simple, understandable &amp;nbsp;and portable. They use intrinsics and require no coding. The only one you need to write is a simple cross product function (or subroutine).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2014 21:45:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969867#M96847</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-01-26T21:45:58Z</dc:date>
    </item>
    <item>
      <title>Oh, sure, for simple 3</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969868#M96848</link>
      <description>&lt;P&gt;Oh, sure, for simple 3 element vectors I WOULD do just that.&lt;/P&gt;

&lt;P&gt;But I wanted to address the issue of "overloaded operators"&lt;/P&gt;

&lt;P&gt;without getting involved in something much more complicated.&lt;/P&gt;

&lt;P&gt;For cross products, I would do something like:&lt;/P&gt;

&lt;P&gt;real(4) A(3),B(3), C(3), Cross&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;C = Cross (a,b)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Where Cross is a function that returns 3 element vectors.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Would I say real(4) Cross(3) or just what is above?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Is there a good article about overloaded operators I can address?&lt;/P&gt;

&lt;P&gt;I have some books about Fortran '90, not sure yet whether this is adequately covered.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 15:49:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969868#M96848</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2014-01-27T15:49:19Z</dc:date>
    </item>
    <item>
      <title>You would define an operator</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969869#M96849</link>
      <description>&lt;P&gt;You would define an operator .CROSS. and write:&lt;/P&gt;

&lt;P&gt;c = a .cross. b&lt;/P&gt;

&lt;P&gt;This is not an overloaded operator, it's a user defined operator. The problem with overloading is that you can't redefine an existing signature, so if you wanted to overload an existing operator you have to satisfy the rules for generic disambiguation and make sure you're not adding a signature that matches an existing one. For the purpose you're describing, a user-defined operator makes more sense and is also more readable (given that assigning weird meanings to existing operators would be confusing.)&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 16:24:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969869#M96849</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-01-27T16:24:48Z</dc:date>
    </item>
    <item>
      <title>IMSL has an entire chapter on</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969870#M96850</link>
      <description>&lt;P&gt;IMSL has an entire chapter on linear operators:&amp;nbsp;&lt;EM&gt;Chapter 10:&lt;/EM&gt;&amp;nbsp;&lt;EM&gt;Linear Algebra Operators and Generic Functions.&amp;nbsp;&lt;/EM&gt;One could use the defined operators (for matrix multiplication, inversion, transpose, etc.) in this chapter as an illustration of what can be done. Of course, one does not get to see how these operators are implemented, and it can be complicated while one is defining new operators to cover all the varieties of expressions where such defined operators could be used.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 16:51:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969870#M96850</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-01-27T16:51:08Z</dc:date>
    </item>
    <item>
      <title>Any volunteer to provide code</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969871#M96851</link>
      <description>&lt;P&gt;Any volunteer to provide code for defining .cross. and a simple example of it's use ?&lt;/P&gt;

&lt;P&gt;I'd be interested to see an extension where the dimension of the vectors is general and not just 3, to see how arbitrary vector sizes are provided.&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 00:11:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969871#M96851</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-01-28T00:11:25Z</dc:date>
    </item>
    <item>
      <title>There are several issues that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969872#M96852</link>
      <description>&lt;P&gt;There are several issues that I need to reply to so I'll reply in separate messages.&lt;/P&gt;

&lt;P&gt;First, I'll reply to the second issue that John Campbell mentioned.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;John Campbell wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I'd be interested to see an extension where the dimension of the vectors is general and not just 3, to see how arbitrary vector sizes are provided.&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The vector cross product is &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt; an operation that can be generalized to an arbitrary number of dimensions.&amp;nbsp; I first learned this in my second semester course in Calculus and Analytic Geometry as a freshman at UW-Madison in the spring of 1974.&amp;nbsp; The vector cross product, as limited to non-trivial products with vector results, is valid only in three (3) and seven (7) dimensions.&amp;nbsp; See the Wikipedia article, "Cross Product":&lt;/P&gt;

&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/Vector_cross_product" target="_blank"&gt;http://en.wikipedia.org/wiki/Vector_cross_product&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 14:55:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969872#M96852</guid>
      <dc:creator>Craig_Dedo</dc:creator>
      <dc:date>2014-01-28T14:55:56Z</dc:date>
    </item>
    <item>
      <title>gfortran testsuite includes</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969873#M96853</link>
      <description>&lt;P&gt;gfortran testsuite includes operator (.cross.) in gcc/testsuite/gfortran.dg/userdef_operator_1.f90&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 15:16:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969873#M96853</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-01-28T15:16:09Z</dc:date>
    </item>
    <item>
      <title>I'd like to follow up on</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969874#M96854</link>
      <description>&lt;P&gt;I'd like to follow up on Steve Lionel's last sentence.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;For the purpose you're describing, a user-defined operator makes more sense and is also more readable (given that assigning weird meanings to existing operators would be confusing.)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;IMHO, assigning weird meanings to existing operators is not just confusing, it is atrocious programming practice.&amp;nbsp; This practice violates just about all principles of good programming practice, most importantly, the Principle of Least Surprise.&lt;/P&gt;

&lt;P&gt;You need to remember that multiplication, signified by *, is commutative.&amp;nbsp; I.e., C = A * B and also C = B * A.&amp;nbsp; This is &lt;EM&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/EM&gt; true with the vector cross product.&amp;nbsp; Instead, the vector cross product is &lt;EM&gt;&lt;STRONG&gt;anti-commutative&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; I.e., if C = A .Cross. B and D = B .Cross. A, then C = -D.&amp;nbsp; I.e., the vectors C and D point in opposite directions, even though they have the same length.&lt;/P&gt;

&lt;P&gt;Thus, it is far better programming practice to create a user-defined operator such as .Cross. to signify the vector cross product.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 15:52:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969874#M96854</guid>
      <dc:creator>Craig_Dedo</dc:creator>
      <dc:date>2014-01-28T15:52:36Z</dc:date>
    </item>
    <item>
      <title>As John Campbell asked, I was</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969875#M96855</link>
      <description>&lt;P&gt;As John Campbell asked, I was going to provide a simple example of how to define a vector cross product and how to use it.&amp;nbsp; This example was going to be a shortened version of a module I wrote for vector operations in October 2011.&amp;nbsp; Due to the need for brevity, I did not include some of the functionality I had in the original module&lt;/P&gt;

&lt;P&gt;However, when I tried to post the example, I got a message, "Your submission has triggered the spam filter and will not be accepted."&lt;/P&gt;

&lt;P&gt;If there is some other way to provide the example I tried to post, please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 19:16:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969875#M96855</guid>
      <dc:creator>Craig_Dedo</dc:creator>
      <dc:date>2014-01-28T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Attaching the source file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969876#M96856</link>
      <description>&lt;P&gt;Attaching the source file should work.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 20:15:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969876#M96856</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-01-28T20:15:11Z</dc:date>
    </item>
    <item>
      <title>The example Tim quoted is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969877#M96857</link>
      <description>&lt;P&gt;The example Tim quoted is below. Personally, I think using a straight function call is more obvious /clear as this stuff isn't much used IMO.&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;OL style="color: rgb(0, 0, 0); font-family: Consolas, monospace; font-size: medium; line-height: normal; white-space: pre;"&gt;
	&lt;LI id="3" style="font-family: 'Courier New', Courier, monospace;"&gt;module geometry&lt;/LI&gt;
	&lt;LI id="4" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="5" style="font-family: 'Courier New', Courier, monospace;"&gt;implicit none&lt;/LI&gt;
	&lt;LI id="6" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="7" style="font-family: 'Courier New', Courier, monospace;"&gt;interface operator(.cross.)&lt;/LI&gt;
	&lt;LI id="8" style="font-family: 'Courier New', Courier, monospace;"&gt;module procedure cross&lt;/LI&gt;
	&lt;LI id="9" style="font-family: 'Courier New', Courier, monospace;"&gt;end interface&lt;/LI&gt;
	&lt;LI id="10" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="11" style="font-family: 'Courier New', Courier, monospace;"&gt;contains&lt;/LI&gt;
	&lt;LI id="12" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="13" style="font-family: 'Courier New', Courier, monospace;"&gt;! Cross product between two 3d vectors.&lt;/LI&gt;
	&lt;LI id="14" style="font-family: 'Courier New', Courier, monospace;"&gt;pure function cross(a, b)&lt;/LI&gt;
	&lt;LI id="15" style="font-family: 'Courier New', Courier, monospace;"&gt;real, dimension(3), intent(in) :: a,b&lt;/LI&gt;
	&lt;LI id="16" style="font-family: 'Courier New', Courier, monospace;"&gt;real, dimension(3) :: cross&lt;/LI&gt;
	&lt;LI id="17" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="18" style="font-family: 'Courier New', Courier, monospace;"&gt;cross = (/ a(2) * b(3) - a(3) * b(2), &amp;amp;&lt;/LI&gt;
	&lt;LI id="19" style="font-family: 'Courier New', Courier, monospace;"&gt;a(3) * b(1) - a(1) * b(3), &amp;amp;&lt;/LI&gt;
	&lt;LI id="20" style="font-family: 'Courier New', Courier, monospace;"&gt;a(1) * b(2) - a(2) * b(1) /)&lt;/LI&gt;
	&lt;LI id="21" style="font-family: 'Courier New', Courier, monospace;"&gt;end function cross&lt;/LI&gt;
	&lt;LI id="22" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="23" style="font-family: 'Courier New', Courier, monospace;"&gt;end module geometry&lt;/LI&gt;
	&lt;LI id="24" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="25" style="font-family: 'Courier New', Courier, monospace;"&gt;program opshape&lt;/LI&gt;
	&lt;LI id="26" style="font-family: 'Courier New', Courier, monospace;"&gt;use geometry&lt;/LI&gt;
	&lt;LI id="27" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="28" style="font-family: 'Courier New', Courier, monospace;"&gt;implicit none&lt;/LI&gt;
	&lt;LI id="29" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="30" style="font-family: 'Courier New', Courier, monospace;"&gt;real :: t(3,3), a&lt;/LI&gt;
	&lt;LI id="31" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="32" style="font-family: 'Courier New', Courier, monospace;"&gt;a = dot_product (t(:,1), t(:,2) .cross. t(:,3))&lt;/LI&gt;
	&lt;LI id="33" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/LI&gt;
	&lt;LI id="34" style="font-family: 'Courier New', Courier, monospace;"&gt;end program opshape&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;[/fortran]&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 20:46:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969877#M96857</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-01-28T20:46:55Z</dc:date>
    </item>
    <item>
      <title>As John Campbell asked, here</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969878#M96858</link>
      <description>&lt;P&gt;As John Campbell asked, here is a simple example of how to define a vector cross product and how to use it.&amp;nbsp; This example is a shortened version of a module I wrote for vector operations in October 2011.&amp;nbsp; Due to the need for brevity, I will not include some of the functionality I have in the original module.&amp;nbsp; The type definitions could also be done with parameterized derived types (PDTs) but not all current Fortran compilers support PDTs.&lt;/P&gt;

&lt;P&gt;The two attachments contain source code that shows how this is done.&amp;nbsp; The file Demo_Vector_3D_M.f90 shows how to define a 3-D vector and some operations, including the vector cross product.&amp;nbsp; The file Demo_Vector_Cross_Product.f90 show how to use a vector cross product&amp;nbsp; operator in a program.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 21:40:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969878#M96858</guid>
      <dc:creator>Craig_Dedo</dc:creator>
      <dc:date>2014-01-28T21:40:28Z</dc:date>
    </item>
    <item>
      <title>I looked at your examples,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969879#M96859</link>
      <description>&lt;P&gt;I looked at your examples, but I don't see how you told the compiler what to do with&lt;/P&gt;

&lt;P&gt;".cross." you use as an operator.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;In other words, is there a place where the compiler associates that with the actual subroutine?&lt;/P&gt;

&lt;P&gt;Of course you also have to make sure that the compiler does NOT treat it as a commutative operator.&lt;/P&gt;

&lt;P&gt;so you would have to define A.cross.B as different than B . cross. A&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 03:46:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969879#M96859</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2014-01-29T03:46:51Z</dc:date>
    </item>
    <item>
      <title>Quote:billsincl wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969880#M96860</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;&amp;nbsp;but I don't see how you told the compiler what to do with&lt;/P&gt;

&lt;P style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;".cross." you use as an operator&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The idiom&lt;/P&gt;

&lt;P&gt;[fortran]&lt;CODE class="keyword" style="font-size: 16px; line-height: 17.88599967956543px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-weight: bold !important; min-height: inherit !important; color: rgb(0, 102, 153) !important;"&gt;interface&lt;/CODE&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 17.88599967956543px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="keyword" style="font-size: 16px; line-height: 17.88599967956543px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-weight: bold !important; min-height: inherit !important; color: rgb(0, 102, 153) !important;"&gt;operator&lt;/CODE&gt;&lt;CODE class="plain" style="font-size: 16px; line-height: 17.88599967956543px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;(.cross.)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain" style="font-size: 16px; line-height: 17.88599967956543px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;module procedure crossproc[/fortran]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain" style="font-size: 16px; line-height: 17.88599967956543px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;tells the compiler to translate "term1 .cross. term2" to "call crossproc(term1,term2)".&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain" style="font-size: 16px; line-height: 17.88599967956543px; color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;The compiler is not expected to possess mathematical knowledge on topics such as commutativity, etc. The code for the procedure that implements the operator should satisfy the requirement that the result of the operation has the correct mathematical properties.&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 04:12:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969880#M96860</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-01-29T04:12:11Z</dc:date>
    </item>
    <item>
      <title>Quote:billsincl wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969881#M96861</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;billsincl wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I looked at your examples, but I don't see how you told the compiler what to do with&lt;/P&gt;

&lt;P&gt;".cross." you use as an operator.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;In other words, is there a place where the compiler associates that with the actual subroutine?&lt;/P&gt;

&lt;P&gt;Of course you also have to make sure that the compiler does NOT treat it as a commutative operator.&lt;/P&gt;

&lt;P&gt;so you would have to define A.cross.B as different than B . cross. A&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Bill,&lt;/P&gt;

&lt;P&gt;Since you're asking very, very basic questions about enhancements to Fortran starting with the Fortran 90 standard, it may help you greatly if you study the various books which explain such topics in detail. &amp;nbsp;See Steve's recent &lt;A href="http://software.intel.com/en-us/blogs/2013/12/30/doctor-fortran-in-its-a-modern-fortran-world"&gt;blogpost&lt;/A&gt; on some of the new books. &amp;nbsp;I'd suggest you start with &lt;A href="http://www.amazon.com/FORTRAN-Engineers-Scientists-Larry-Nyhoff/dp/0135197295/ref=sr_1_6?ie=UTF8&amp;amp;qid=1390972350&amp;amp;sr=8-6&amp;amp;keywords=Sanford+Leestma"&gt;"FORTRAN 90 for Engineers and Scientists"&lt;/A&gt; by Nyhoff and Leestma,&amp;nbsp;&lt;B&gt;ISBN-13:&lt;/B&gt;&amp;nbsp;978-0135197295. &amp;nbsp;Studying these books will give you an all-around view and a far deeper understanding of "Modern Fortran" that simply cannot be offered by such forum posts and responses.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 05:17:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969881#M96861</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-01-29T05:17:05Z</dc:date>
    </item>
    <item>
      <title>Thanks Craig and app4619 for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969882#M96862</link>
      <description>&lt;P&gt;Thanks Craig and app4619 for your examples of the coding for .cross. They give me a good indication of what is required.&lt;/P&gt;

&lt;P&gt;Bill, as A .cross. B = - B .cross. A, the example of "t(:,2) .cross. t(:,3)" has no ambiguity of order assumed.&lt;/P&gt;

&lt;P&gt;I have always used a subroutine dcross (a, b, c) where C = A x B, rather than using a vector function. I'm not sure if I will adopt the use of .cross.&amp;nbsp; Given my recent interest in AVX performance, I wonder if adopting .cross. would have any benefit ?&lt;/P&gt;

&lt;P&gt;Interesting topic,&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 05:19:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969882#M96862</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-01-29T05:19:13Z</dc:date>
    </item>
    <item>
      <title>It is my impression of F2003</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969883#M96863</link>
      <description>&lt;P&gt;It is my impression of F2003 and F2008 that the expanded language now provides for many alternatives for coding some basic approaches, such as vector algebra or list processing.&lt;/P&gt;

&lt;P&gt;I'm with Bill in some of these, as it becomes difficult to identify if the new alternative syntax provides any benefit for solving the basic problem. While new syntax provides alternative ways of coding, which hopefully provides ways of expanding the range of problems that can be solved, they also introduce new ways of hiding coding bugs which means that no problems are robustly solved.&lt;/P&gt;

&lt;P&gt;I need to broaden my horizons and look for new problems to solve, rather than redefining the problems I already have.&lt;/P&gt;

&lt;P&gt;john&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 05:30:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-about-extended-use-of-operators/m-p/969883#M96863</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-01-29T05:30:30Z</dc:date>
    </item>
  </channel>
</rss>

