[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

Find the smalles Keys in a Vector

Hi all

I have double vectors
a:: {78.00 43.00 10.00};

b::  (1...n) vectors in a set
Node 0: (0 0)
weight vector: 1.00 1.00 1.00
I have  a method get_weight_vector() ..  I can use this to get individual vectors
wVector = map(i).get_weight_vector(); // returns arrary of a vector e.g 1.00 1.00 1.00
I have another method that compare the value of a and b
and returns type double = 72.12489168102785

Now for all b's sets compared with static a :
I need to get the smallest value return:: and with the smalles values reference key..
Return the set that the smallest value belongs to..

below see below for more info..
public double (double map)
		double[] staticVector = {78.00 43.00 10.00};
		double[] wVector;
		double startValue  =  0.0;
		for(int i=0; i<map.length; i++){
		// method get weight vector return series of : 78.00 43.00 10.00 ;78.00 43.00 10.00 .. 5
		wVector = map[i].get_weight_vector(); // returns arrary of all the values  ALL
		double returnedValue = (wVector,  staticVector);  // returns double in format 72.12489168102785
		//for map[i] with the smallest retured key value.. return the corresponding map Items
		//Node 0: (0 0)
		//weight vector: 1.00 1.00 1.00 
		 if (startValue < returnedValue) // If start value is less than return value 
			 startValue  = returnedValue; // somehow I need to change the startValue to the smallest value
			 // or keep a reference to the smallest key during the interation
		 sort map.. until we find the map with smalles key value
		 If we find the smallest.. return the set: 

Open in new window

  • 2
1 Solution
ZURINETAuthor Commented:
Hi all
For those who might be still working on this problem ..
This problem has been solved..
will close in in 5 mins  ... sorry
ZURINETAuthor Commented:
Solve the problem

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now