niessner / Opt

Opt DSL
Other
256 stars 68 forks source link

createEmptyOptImage isUnknown parameter #94

Closed mihaibujanca closed 7 years ago

mihaibujanca commented 7 years ago

Apologies for the multiple issues opened. I've been going a bit through the code and am trying to understand the purpose of the isUnknown parameter in createEmptyOptImage - and whether or not it's actually used.

I assumed that is would be used for variables that are indeed unknowns (and expected the Opt code to match that), but, for example in the ARAP code:

m_vertexPosFloat3                = createEmptyOptImage(m_dims, OptImage::Type::FLOAT, 3, OptImage::GPU, true);
m_vertexPosFloat3InitialShape    = createEmptyOptImage(m_dims, OptImage::Type::FLOAT, 3, OptImage::GPU, true);
m_vertexPosTargetFloat3     = createEmptyOptImage(m_dims, OptImage::Type::FLOAT, 3, OptImage::GPU, true);

m_problemParams.set("Offset", m_vertexPosFloat3);
m_problemParams.set("UrShape", m_vertexPosFloat3UrShape);
m_problemParams.set("Constraints", m_vertexPosTargetFloat3);
local Offset =      Unknown("Offset", opt_float3,{N},0)
local UrShape  =     Array("Initial",opt_float3,{N},2) 
local Constraints = Array("Constraints",opt_float3,{N},3)

In fact, throughout all examples, the only place where the parameter is set to false is in the shape_from_shading code, for the mask parameters.

Mx7f commented 7 years ago

That seems to be a straight up misnomer, it is only used for automatic conversion float<->double based on whether useDoublePrecision is set. Opened a task for rename/refactoring in #95