Difference between revisions of "830 - Haplotyper::ScoreLeftConditional()"

From Genome Analysis Wiki
Jump to navigationJump to search
(Created page with "void Haplotyper::ScoreLeftConditional() { ResetMemoryPool(); GetMemoryBlock(0); SetupPrior(leftMatrices[0]); ConditionOnData(leftMatrices[0], 0, current_genoty...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<source lang="cpp">
 +
 
void Haplotyper::ScoreLeftConditional()
 
void Haplotyper::ScoreLeftConditional()
 
   {
 
   {
Line 8: Line 10:
  
 
   double theta = 0.0;
 
   double theta = 0.0;
  float *from = leftMatrices[0];
 
 
   for (int i = 1; i < markers; i++)
 
   for (int i = 1; i < markers; i++)
 
       {
 
       {
       // Cumulative recombination fraction allows us to skip uninformative positions
+
       GetMemoryBlock(i);
      theta = theta + thetas[i - 1] - theta * thetas[i - 1];
 
 
 
      // Skip over uninformative positions to save time
 
      if (current_genotypes[i] != GENOTYPE_MISSING || i == markers - 1)
 
        {
 
        GetMemoryBlock(i);
 
 
 
        Transpose(from, leftMatrices[i], theta);
 
        ConditionOnData(leftMatrices[i], i, current_genotypes[i]);
 
  
        theta = 0;
+
      Transpose(leftMatrices[i-1], leftMatrices[i], thetas[i-1]);
        from = leftMatrices[i];
+
      ConditionOnData(leftMatrices[i], i, current_genotypes[i]);
        }
 
 
       }
 
       }
 
   }
 
   }
 +
</source>

Latest revision as of 13:30, 2 October 2013

void Haplotyper::ScoreLeftConditional()
   {
   ResetMemoryPool();
   GetMemoryBlock(0);

   SetupPrior(leftMatrices[0]);
   ConditionOnData(leftMatrices[0], 0, current_genotypes[0]);

   double theta = 0.0;
   for (int i = 1; i < markers; i++)
      {
      GetMemoryBlock(i);

      Transpose(leftMatrices[i-1], leftMatrices[i], thetas[i-1]);
      ConditionOnData(leftMatrices[i], i, current_genotypes[i]);
      }
   }