from collections import OrderedDict
import numpy as np

import theano
from theano.ifelse import ifelse
import theano.tensor as T
import theano.tensor.inplace as inplace
#from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theano.tensor.shared_randomstreams import RandomStreams
import time


#theano.config.compute_test_value = 'warn'
#theano.config.exception_verbosity='high'
#theano.config.profile=True
#theano.config.mode = "FAST_RUN"
#theano.config.mode = "FAST_COMPILE"
#theano.config.scan.allow_gc =True
#theano.config.scan.allow_output_prealloc =False
#theano.optimizer_excluding="more_mem"

# initializing
rng = RandomStreams(seed=234)
photons = 10**6
SHELL_MAX = 101


mu_a = T.scalar('mu_a')
# provide Theano with a default test-value
mu_a.tag.test_value = 2.
mu_s = T.scalar('mu_s')
mu_s.tag.test_value = 20.
microns_per_shell = T.scalar('microns_per_shell')
microns_per_shell.tag.test_value = 50.

albedo = mu_s / (mu_s + mu_a)
shells_per_mfp = 1e4/microns_per_shell/(mu_a+mu_s)

heat = theano.shared(np.zeros(SHELL_MAX, dtype=theano.config.floatX))

x = T.scalar('x')
x.tag.test_value = 0

y = T.scalar('y')
y.tag.test_value = 0

z = T.scalar('z')
z.tag.test_value = 0

u = T.scalar('u')
u.tag.test_value = 0

v = T.scalar('v')
v.tag.test_value = 0

w = T.scalar('w')
w.tag.test_value = 1

weight = T.scalar('weight')
weight.tag.test_value = 1