ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/math/linearAlgebra.F90
Revision: 2592
Committed: Thu Feb 16 21:40:20 2006 UTC (18 years, 4 months ago) by gezelter
File size: 626 byte(s)
Log Message:
fixed a problem with cutoff radii being set larger than 1/2 the
length of the shortest box dimension.  added a few fortran utility
routines

File Contents

# Content
1 module linearAlgebra
2
3 use definitions
4 implicit none
5
6 CONTAINS
7
8 function cross_product(vec1,vec2)
9
10 real(kind=dp), dimension(3) :: cross_product
11 real(kind=dp), dimension(3),intent(in) :: vec1, vec2
12
13 cross_product(1) = vec1(2) * vec2(3) - vec1(3) * vec2(2)
14 cross_product(2) = vec1(3) * vec2(1) - vec1(1) * vec2(3)
15 cross_product(3) = vec1(1) * vec2(2) - vec1(2) * vec2(1)
16
17 end function cross_product
18
19 function length(vec1)
20
21 real(kind=dp) :: length
22 real(kind=dp), dimension(3),intent(in) :: vec1
23
24 length = sqrt(dot_product(vec1, vec1))
25 end function length
26
27 end module linearAlgebra