#NEWLINE# def test_fcode_results_named_ordered( ) : #NEWLINE# #INDENT# ( x , y , z ) = symbols ( 'x,y,z' ) #NEWLINE# ( B , C ) = symbols ( 'B,C' ) #NEWLINE# A = MatrixSymbol ( 'A' , 1 , 3 ) #NEWLINE# expr1 = Equality ( A , Matrix ( [ [ 1 , 2 , x ] ] ) ) #NEWLINE# expr2 = Equality ( C , ( ( x + y ) * z ) ) #NEWLINE# expr3 = Equality ( B , ( 2 * x ) ) #NEWLINE# name_expr = ( 'test' , [ expr1 , expr2 , expr3 ] ) #NEWLINE# result = codegen ( name_expr , 'f95' , 'test' , header = False , empty = False , argument_sequence = ( x , z , y , expr2 , A , B ) ) #NEWLINE# source = result [ 0 ] [ 1 ] #NEWLINE# expected = 'subroutine test(x, z, y, C, A, B)\nimplicit none\nREAL*8, intent(in) :: x\nREAL*8, intent(in) :: z\nREAL*8, intent(in) :: y\nREAL*8, intent(out) :: C\nREAL*8, intent(out) :: B\nREAL*8, intent(out), dimension(1:1, 1:3) :: A\nC = z*(x + y)\nA(1, 1) = 1\nA(1, 2) = 2\nA(1, 3) = x\nB = 2*x\nend subroutine\n' #NEWLINE# assert ( source == expected )