Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

# -*- coding: utf-8 -*- 

from __future__ import ( 

    print_function, division, absolute_import, unicode_literals 

) 

 

import numpy as np 

 

from chemreac.symbolic import SymRD 

 

 

def test_SymRD(): 

    rd = SymRD(2, [[0]], [[1]], k=[5.0]) 

 

    fout = rd.alloc_fout() 

    rd.f(0, [7, 3], fout) 

    assert np.allclose(fout, [-5*7, 5*7]) 

 

    jout = rd.alloc_jout(banded=False) 

    rd.dense_jac_rmaj(0, [7, 3], jout) 

    assert np.allclose(jout, [[-5.0, 0.0], [5.0, 0.0]])