// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dimreduction.c
// Function: dimension_reduction_isomap
Instanceptr dimension_reduction_isomap(Datasetptr d, Instanceptr traindata, void* parameters, Datasetptr* new_dataset, char* new_dataset_name)
{
 /*!Last Changed 18.01.2008*/
 int howmany;
 matrix eigenvectors, distancematrix, b;
 double *eigenvalues;
 Isomap_parameterptr pisomap = (Isomap_parameterptr) parameters;
 Instanceptr newlist;
 switch (pisomap->neighborhood_type)
  {
   case NEIGHBORHOOD_TYPE_EPSILON:distancematrix = distance_matrix_with_threshold(traindata, pisomap->epsilon);
                                  break;
   case       NEIGHBORHOOD_TYPE_K:distancematrix = distance_matrix_with_k(traindata, pisomap->k);
                                  break;
  } 
 floyds_all_pairs_shortest_path_algorithm(&distancematrix);
 if (!graph_connected(distancematrix))
  {
   printf(m1393);
   matrix_free(distancematrix);
   return NULL;
  }
 b = multi_dimensional_scaling(distancematrix);
 matrix_free(distancematrix);
 switch (pisomap->ppca.reduction_type)
  {
   case REDUCTION_TYPE_FEATURE :eigenvalues = find_eigenvalues_eigenvectors_symmetric(&eigenvectors, b);
                                howmany = pisomap->ppca.featurecount;
                                break;
   case REDUCTION_TYPE_VARIANCE:eigenvalues = find_eigenvalues_eigenvectors(&eigenvectors, b, &howmany, pisomap->ppca.variance_explained);
                                break;
  }
 matrix_free(b);
 newlist = reduce_dimension_of_instancelist_mds(traindata, howmany, eigenvectors, eigenvalues);
 *new_dataset = dimension_reduced_dataset(d, howmany + 1, newlist, new_dataset_name);
 return newlist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0xbc(%rbp)
testl %eax, %eax
je 0x2bc57
jmp 0x2bc4a
movl -0xbc(%rbp), %eax
subl $0x1, %eax
je 0x2bc8f
jmp 0x2bcc3
movq -0x18(%rbp), %rdi
movq -0x80(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x17370
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x2bcc3
movq -0x18(%rbp), %rdi
movq -0x80(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x17480
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x26450
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x262b0
cmpl $0x0, %eax
jne 0x2bd06
leaq 0xb88e8(%rip), %rdi     # 0xe45cd
movb $0x0, %al
callq 0x4030
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x59ea0
movq $0x0, -0x8(%rbp)
jmp 0x2bdf6
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2cda0
movq %rax, -0xb8(%rbp)
movq %rdx, -0xb0(%rbp)
movups -0xb8(%rbp), %xmm0
movaps %xmm0, -0x70(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x59ea0
movq -0x80(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xc0(%rbp)
testl %eax, %eax
je 0x2bd59
jmp 0x2bd4c
movl -0xc0(%rbp), %eax
subl $0x1, %eax
je 0x2bd79
jmp 0x2bd9b
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x5fb50
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
jmp 0x2bd9b
movq -0x80(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x48(%rbp), %rdi
leaq -0x34(%rbp), %rcx
callq 0x5fba0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x59ea0
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x78(%rbp), %r8
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x2cba0
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
addl $0x1, %esi
movq -0x88(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x1e1d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)