@@ -6,7 +6,6 @@ using DiffMatic
66using Test
77
88using DiffMatic: Variable, Literal, KrD, Zero
9- using DiffMatic: evaluate
109using DiffMatic: Upper, Lower
1110
1211dc = DiffMatic
@@ -273,10 +272,10 @@ end
273272 A = Variable (" A" , Upper (1 ), Lower (2 ))
274273 B = Variable (" B" , Upper (1 ), Lower (2 ))
275274
276- p1 = dc . evaluate ( A * B)
277- p2 = dc . evaluate ( A' * B)
278- p3 = dc . evaluate ( A * B' )
279- p4 = dc . evaluate ( A' * B' )
275+ p1 = A * B
276+ p2 = A' * B
277+ p3 = A * B'
278+ p4 = A' * B'
280279
281280 @test length (dc. get_free_indices (p1)) == 2
282281 @test p1. arg1. indices[2 ]. letter == p1. arg2. indices[1 ]. letter
@@ -355,20 +354,20 @@ end
355354 op1 = A .* A
356355
357356 @test typeof (op1) == dc. BinaryOperation{dc. Mult}
358- @test equivalent (evaluate ( op1. arg1) , Variable (" A" , Upper (1 ), Lower (2 )))
359- @test equivalent (evaluate ( op1. arg2) , Variable (" A" , Upper (1 ), Lower (2 )))
357+ @test equivalent (op1. arg1, Variable (" A" , Upper (1 ), Lower (2 )))
358+ @test equivalent (op1. arg2, Variable (" A" , Upper (1 ), Lower (2 )))
360359
361360 op2 = A .* B
362361
363362 @test typeof (op2) == dc. BinaryOperation{dc. Mult}
364- @test equivalent (evaluate ( op2. arg1) , Variable (" A" , Upper (3 ), Lower (4 )))
365- @test equivalent (evaluate ( op2. arg2) , Variable (" B" , Upper (3 ), Lower (4 )))
363+ @test equivalent (op2. arg1, Variable (" A" , Upper (3 ), Lower (4 )))
364+ @test equivalent (op2. arg2, Variable (" B" , Upper (3 ), Lower (4 )))
366365
367366 op3 = A' .* B'
368367
369368 @test typeof (op3) == dc. BinaryOperation{dc. Mult}
370- @test equivalent (evaluate ( op3. arg1) , Variable (" A" , Lower (1 ), Upper (2 )))
371- @test equivalent (evaluate ( op3. arg2) , Variable (" B" , Lower (3 ), Upper (4 )))
369+ @test equivalent (op3. arg1, Variable (" A" , Lower (1 ), Upper (2 )))
370+ @test equivalent (op3. arg2, Variable (" B" , Lower (3 ), Upper (4 )))
372371end
373372
374373@testset " elementwise multiplication vector-vector" begin
@@ -378,20 +377,20 @@ end
378377 op1 = x .* x
379378
380379 @test typeof (op1) == dc. BinaryOperation{dc. Mult}
381- @test equivalent (evaluate ( op1. arg1) , Variable (" x" , Upper (1 )))
382- @test equivalent (evaluate ( op1. arg2) , Variable (" x" , Upper (1 )))
380+ @test equivalent (op1. arg1, Variable (" x" , Upper (1 )))
381+ @test equivalent (op1. arg2, Variable (" x" , Upper (1 )))
383382
384383 op2 = x .* y
385384
386385 @test typeof (op2) == dc. BinaryOperation{dc. Mult}
387- @test equivalent (evaluate ( op2. arg1) , Variable (" x" , Upper (2 )))
388- @test equivalent (evaluate ( op2. arg2) , Variable (" y" , Upper (2 )))
386+ @test equivalent (op2. arg1, Variable (" x" , Upper (2 )))
387+ @test equivalent (op2. arg2, Variable (" y" , Upper (2 )))
389388
390389 op3 = x' .* y'
391390
392391 @test typeof (op3) == dc. BinaryOperation{dc. Mult}
393- @test equivalent (evaluate ( op3. arg1) , Variable (" x" , Lower (2 )))
394- @test equivalent (evaluate ( op3. arg2) , Variable (" y" , Lower (2 )))
392+ @test equivalent (op3. arg1, Variable (" x" , Lower (2 )))
393+ @test equivalent (op3. arg2, Variable (" y" , Lower (2 )))
395394end
396395
397396@testset " elementwise multiplication with ambiguous input fails" begin
@@ -439,22 +438,22 @@ end
439438 x = Variable (" x" , Upper (1 ))
440439 y = Variable (" y" , Lower (1 ))
441440
442- @test equivalent (evaluate (x ' ) , Variable (" x" , Lower (1 )))
443- @test equivalent (evaluate (y ' ) , Variable (" y" , Upper (1 )))
441+ @test equivalent (x ' , Variable (" x" , Lower (1 )))
442+ @test equivalent (y ' , Variable (" y" , Upper (1 )))
444443end
445444
446445@testset " transpose KrD" begin
447446 d = KrD (Upper (1 ), Lower (2 ))
448447
449- @test equivalent (evaluate (d ' ) , KrD (Lower (1 ), Upper (2 )))
448+ @test equivalent (d ' , KrD (Lower (1 ), Upper (2 )))
450449end
451450
452451@testset " combined update_index and transpose vector" begin
453452 x = Variable (" x" , Upper (2 ))
454453
455454 xt = x'
456455 x_indices = dc. get_free_indices (xt)
457- updated_transpose = evaluate ( dc. update_index (xt, x_indices[1 ], Lower (1 ) ))
456+ updated_transpose = dc. update_index (xt, x_indices[1 ], Lower (1 ))
458457
459458 @test equivalent (updated_transpose, Variable (" x" , Lower (1 )))
460459end
@@ -491,17 +490,16 @@ end
491490@testset " transpose matrix" begin
492491 A = Variable (" A" , Upper (1 ), Lower (2 ))
493492
494- At = evaluate (A' )
495- @test equivalent (At, Variable (" A" , Lower (1 ), Upper (2 )))
493+ @test equivalent (A' , Variable (" A" , Lower (1 ), Upper (2 )))
496494end
497495
498496@testset " transpose BinaryOperation{dc.Mult}" begin
499497 A = Variable (" A" , Upper (1 ), Lower (2 ))
500498 x = Variable (" x" , Upper (2 ))
501499
502- op_t = evaluate (( A * x)' )
500+ op_t = ( A * x)'
503501 @test equivalent (
504- evaluate ( op_t) ,
502+ op_t,
505503 dc. BinaryOperation {dc.Mult} (
506504 Variable (" A" , Lower (1 ), Lower (2 )),
507505 Variable (" x" , Upper (2 )),
534532 B = Variable (" B" , Upper (2 ), Lower (3 ))
535533
536534 @test equivalent (
537- evaluate ( A + B) ,
535+ A + B,
538536 dc. BinaryOperation {dc.Add} (
539537 Variable (" A" , Upper (1 ), Lower (2 )),
540538 Variable (" B" , Upper (1 ), Lower (2 )),
552550
553551 for op ∈ (+ , - )
554552 for args ∈ ((x, y), (A, B))
555- e = evaluate (( op (args[1 ], args[2 ])) )
553+ e = op (args[1 ], args[2 ])
556554 @test e. arg1. indices == e. arg2. indices
557555 end
558556 end
565563
566564 for op ∈ (+ , - )
567565 for ags ∈ ((x, y), (x, z))
568- op_t = evaluate (( op (x, y)) ' )
566+ op_t = op (x, y)'
569567 @test op_t. arg1. indices == op_t. arg2. indices
570568 end
571569 end
0 commit comments